Apache htaccess url重写规则
我正在为可选查询字符串使用以下htaccess url重写规则Apache htaccess url重写规则,apache,.htaccess,mod-rewrite,Apache,.htaccess,Mod Rewrite,我正在为可选查询字符串使用以下htaccess url重写规则 Options +FollowSymlinks -MultiViews RewriteEngine On RewriteRule ^post/([0-9]+)?$ post.php?state=$1 [NC,L] RewriteRule ^post/([0-9]+)/([a-z0-9\-]+)?$ post.php?state=$1&zone=$2 [NC,L] RewriteRule ^post/([0-9]+)/([
Options +FollowSymlinks -MultiViews
RewriteEngine On
RewriteRule ^post/([0-9]+)?$ post.php?state=$1 [NC,L]
RewriteRule ^post/([0-9]+)/([a-z0-9\-]+)?$ post.php?state=$1&zone=$2 [NC,L]
RewriteRule ^post/([0-9]+)/([a-z0-9\-]+)/([a-z0-9\-]+)?$ post.php?state=$1&zone=$2®ion=$3 [NC,L]
RewriteRule ^post/([0-9]+)/([a-z0-9\-]+)/([a-z0-9\-]+)/([a-z0-9\-]+)?$ post.php?state=$1&zone=$2®ion=$3&sub_region=$4 [NC,L]
RewriteRule ^post/([0-9]+)/([a-z0-9\-]+)/([a-z0-9\-]+)/([a-z0-9\-]+)/([a-z0-9\-]+)?$ post.php?state=$1&zone=$2®ion=$3&sub_region=$4&suburb=$5 [NC,L]
RewriteRule ^post/([0-9]+)/([a-z0-9\-]+)/([a-z0-9\-]+)/([a-z0-9\-]+)/([a-z0-9\-]+)/([a-z0-9\-]+)?$ post.php?state=$1&zone=$2®ion=$3&sub_region=$4&suburb=$5&postcode=$6 [NC,L]
它太慢了,你能建议更好的方法来达到同样的效果吗。谢谢你确定制定的规则很慢吗?@JonLin是的,这是正确的方法吗?我有数百条这样的规则,如果我有1条或超过100条,响应时间没有区别。