2015-12-10 64 views
1

我需要從 http://masterkanz.com.ua/index.php?route=product/category&path=79_103 頁面重定向到 http://masterkanz.com.ua/pishushchie-prinadlezhnosti/ruchki-sharikovye重定向301使用的.htaccess

規則像

Redirect 301 /index.php?route=product/category&path=79_103 http://masterkanz.com.ua/pishushchie-prinadlezhnosti/ruchki-sharikovye 

犯規作品。我讀到這個問題可以用符號「?」來表示。但我該怎麼辦?

+0

問題是您正在使用錯誤的指令來匹配查詢字符串。檢查@Nikhil的答案波紋管 – starkeen

回答

3

試試這個,

RewriteEngine On 
RewriteCond %{QUERY_STRING} ^route=product/category&path=79_103$ 
RewriteRule ^index\.php/?$ http://masterkanz.com.ua/pishushchie-prinadlezhnosti/ruchki-sharikovye? [R=301,L] 

我已經試過這一點,這是工作,你需要使用{} QUERY_STRING得到規則工作。

我希望這會有所幫助。

+1

問號在目標網址的末尾很重要,因爲它從目標網址中刪除了原始查詢字符串 – starkeen

+0

它確實有效。 – ArtemPetrov