2016-02-20 155 views
1

當爲prestashop網站創建一個重定向301並插入我的下面的代碼的所有罰款的htaccess第一行。但是對於類別和產品,htaccess會將所有用戶發送到不存在的頁面上。應該使用哪些設置來讀取prestashop網址中的所有參數。重定向301 htaccess prestashop

#URL rewriting module activation 
RewriteEngine on 

Redirect 301 /contact-form.php http://sitoweb.eu/ 
Redirect 301 /category.php?id_category=73 http://sitoweb.eu/ 

回答

0

來匹配查詢字符串,您需要使用的RewriteCond重寫規則,並作爲查詢字符串是不匹配的重定向指令的一部分。

試試這個:

RewriteEngine on 

RewriteRule ^contact-form\.php$ http://siteweb.eu/ [NC,L,R] 
RewriteCond %{QUERY_STRING} ^id_category=73$ 
RewriteRule ^category\.php$ http://siteweb.eu/ [L,R] 
+1

大,做工精細! – Andreis