我想修改重写网址,我只是想知道如何重写我的查询字符串类型的网址
http://localhost/folder/index.php?param1=value1¶m2=value2¶m3=value3
进入
http://localhost/folder/value1/value2/value3
我有这个htaccess文件请告诉我它是否正确
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^index/(w+)/(w+)/(w+)$ /index.php?param1=$1¶m2=$2¶m3=$3 [nc]
答案 0 :(得分:1)
在DOCUMENT_ROOT的.htaccess文件中使用此代码:
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{QUERY_STRING} !param1= [NC]
RewriteRule ^([^/]*)/([^/]*)/([^/]*)/([^/]*)$ $1/index.php?param1=$2¶m2=$3¶m3=$4 [QSA,L]