用多个参数重写.htaccess

时间:2015-01-18 10:52:54

标签: .htaccess

我希望将/q.php?start=0&co=US&l=AL&s=hotel重写为/us/al/hotel

我尝试了这个,但是我收到了错误 - 没有找到。这是我的htaccess

RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)/([^/]*)$ /q.php?start=0&co=$1&l=$2&s=$3 [L]

1 个答案:

答案 0 :(得分:0)

这应该对你有用

RewriteEngine On
RewriteRule ^([^/]+)/([^/]+)/([^/]+)$ /q.php?start=0&co=$1&l=$2&s=$3 [L]