下面的 mod 重写不起作用.. 例如,使用http://www.mywebsite.com/category/general之类的 url .. 我收到 404 错误。
RewriteEngine On
RewriteBase /
RewriteRule ^category/([A-Za-z0-9-]+)&type=([A-Za-z0-9-]+)&r=([A-Za-z0-9-]+)&g=([A-Za-z0-9-]+)&page=([A-Za-z0-9-]+)/?$ /category.php?c=$1&type=$2&r=$3&g=$4&page=$5 [L]
如果我使用下面的 mod rewrite 它可以工作,难道不应该有更好的方法而不是必须输入所有组合。
RewriteRule ^category/([A-Za-z0-9-]+)/?$ /category.php?c=$1 [L]
RewriteRule ^category/([A-Za-z0-9-]+)&type=([A-Za-z0-9-]+)/?$ /category.php?c=$1&type=$2 [L]
RewriteRule ^category/([A-Za-z0-9-]+)&page=([A-Za-z0-9-]+)/?$ /category.php?c=$1&page=$2 [L]
RewriteRule ^category/([A-Za-z0-9-]+)&type=([A-Za-z0-9-]+)&page=([A-Za-z0-9-]+)/?$ /category.php?c=$1&type=$2&page=$3 [L]
RewriteRule ^category/([A-Za-z0-9-]+)&r=([A-Za-z0-9-]+)/?$ /category.php?c=$1&r=$2 [L]
RewriteRule ^category/([A-Za-z0-9-]+)&type=([A-Za-z0-9-]+)&r=([A-Za-z0-9-]+)/?$ /category.php?c=$1&type$2&r=$3 [L]
RewriteRule ^category/([A-Za-z0-9-]+)&r=([A-Za-z0-9-]+)&page=([A-Za-z0-9-]+)/?$ /category.php?c=$1&r=$2&page=$3 [L]
RewriteRule ^category/([A-Za-z0-9-]+)&type=([A-Za-z0-9-]+)&r=([A-Za-z0-9-]+)&g=([A-Za-z0-9-]+)&page=([A-Za-z0-9-]+)/?$ /category.php?c=$1&type=$2&r=$3&g=$4&page=$5 [L]