2016-02-20 157 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