我想从多个php文件处理多个get请求。在这种情况下,RewriteRule ^m(.*)/?$ menu-products.php?view_menu=$1 [NC,L]
部分工作正常,但RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.*)/?$ single-product.php?view_product=$1 [NC,L]
RewriteRule ^m(.*)/?$ menu-products.php?view_menu=$1 [NC,L]
RewriteCond %{THE_REQUEST} ^.*/index\.php
RewriteRule ^(.*)index.php$ /$1 [R=301,L]
部分不起作用。任何解决方案?
{{1}}
答案 0 :(得分:0)
第二条规则永远不会运行,因为第一条规则与之匹配。交换它们:
RewriteRule ^m(.*)/?$ menu-products.php?view_menu=$1 [NC,L]
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.*)/?$ single-product.php?view_product=$1 [NC,L]