我正在尝试为查询字符串编写mod重写。
我有一个这样的网址:
http://test.co.uk/test-app/?option=com_testdetails&view=testingdetail&testhotel=105680&testhotelname=Sheraton%20Tel%20Aviv%20Hotel&testhotellocation=Near%20Gordon%20Beach
我试过了
RewriteCond %{QUERY_STRING} ^option=com_testdetails&view=testingdetail&testhotel=([^&]*)&testhotelname=([^&]*)&testhotellocation=([^&]*)$ [NC]
RewriteRule ^([^/]*)/([^/]*)\.html$ /([^/]*)/?option=com_testdetails&view=testingdetail&testhotel=([^&]*)&testhotelname=$1&testhotellocation=$2 [L]
但上面的内容不起作用,我用
进行了测试`http://martinmelin.se/rewrite-rule-tester/`and http://www.generateit.net/mod-rewrite/index.php
我得到的结果是
http://test.co.uk/-?option=com_testdetails&view=testingdetail&testhotel=105680&testhotelname=Sheraton Tel Aviv Hotel&testhotellocation=Near Gordon Beach
我希望网址像
http://test.co.uk/test-app/Sheraton Tel Aviv Hotel/testhotellocation=Near Gordon Beach
请让我知道我哪里出错了,如果你可以帮助我,那就太好了......
此致 洁