我有一个包含这些参数的 URL listing.php?category=Pharmaceutical
但我希望它像
/category=Pharmaceutical
我在这里使用 .htaccess 代码
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^category/(d+)*$ ./listing.php?category==$1
但这不起作用,有没有其他方法可以做到这一点。
从外部重定向/dir/foo.php?category=123
RewriteCond %{THE_REQUEST} ^GET\s([^.]+(.php\?category=([^&]+( [NC]
重写规则 ^ %1/%2/%3?[R,L]
RewriteCond %{THE_REQUEST} ^GET\s([^.]+(.php\?category=([^&\s]+(\s [NC]
重写规则 ^ %1/%2?[R,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
重写规则 ^(.+?/([^/]+((/[^/]+(?/?$ $1.php?category=$2 [L,QSA]