Url重写Html页面

时间:2014-09-13 07:18:08

标签: apache .htaccess mod-rewrite

我正在使用.htaccess进行网址重定向。我已经尝试了很多东西,但它给了我"没有找到" ERROR

我目前的网址是

http://localhost:8089/travell/search.html?/india/goa

我需要网址

http://localhost:8089/vacation/india/goa

我的htaccess文件正在

RewriteRule ^(.*)?search.html http://localhost:8089/vacation?%{Query_string} [P]

1 个答案:

答案 0 :(得分:3)

你的规则正在逆转。在root .htaccess中使用此规则:

RewriteEngine On
RewriteRule ^vacation/(.+)$ travell/search.html?$1 [L,NC,QSA]

然后在浏览器中输入http://localhost:8089/vacation/india/goa进行测试。

相关问题