Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache htaccess url重写规则_Apache_.htaccess_Mod Rewrite - Fatal编程技术网

Apache 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]+)/([

我正在为可选查询字符串使用以下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]+)/([a-z0-9\-]+)/([a-z0-9\-]+)?$ post.php?state=$1&zone=$2&region=$3 [NC,L]
RewriteRule ^post/([0-9]+)/([a-z0-9\-]+)/([a-z0-9\-]+)/([a-z0-9\-]+)?$ post.php?state=$1&zone=$2&region=$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&region=$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&region=$3&sub_region=$4&suburb=$5&postcode=$6 [NC,L]

它太慢了,你能建议更好的方法来达到同样的效果吗。谢谢

你确定制定的规则很慢吗?@JonLin是的,这是正确的方法吗?我有数百条这样的规则,如果我有1条或超过100条,响应时间没有区别。