htaccess url重写规则

时间:2014-05-01 03:10:48

标签: 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]+)/([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]

它太慢了,请你建议更好的方法来实现同样的目标。感谢

0 个答案:

没有答案