0
我試過使用RewriteCond和RewriteRule將一個複雜的URL重定向到一個新頁面,但沒有成功。用複雜查詢字符串重定向url
的原始網址:?
的index.php選項= com_k2 &視圖=項目& ID = 127 &的itemid = 353 或http://www.example.com/index.php?option=com_k2&view=item&id=127&Itemid=353
曾嘗試:
RewriteRule ^index.php?option=com_k2&view=item&id=127& Itemid=353$ http://www.example.com/somepage [R=301,L]
另外:
RewriteCond %{QUERY_STRING} index.php?option=com_k2&view=item&id=127&Itemid=353
RewriteRule http://www.example.com/somepage [R=301]
And:
RewriteCond %{QUERY_STRING} ^id=127&Itemid=353$
RewriteRule ^$ http://www.example.com/somepage [R=301]
我在想什麼?
這就是它!我測試過,它完美地工作。 – 2015-02-10 01:49:26