Apache 重定向301 htaccess prestashop
当为prestashop网站创建重定向301并在htaccess中插入我下面代码的第一行时,一切正常。但对于类别和产品,htaccess将所有用户发送到一个不存在的页面上。读取prestashop URL中的所有这些参数时应使用哪些设置Apache 重定向301 htaccess prestashop,apache,.htaccess,mod-rewrite,seo,prestashop,Apache,.htaccess,Mod Rewrite,Seo,Prestashop,当为prestashop网站创建重定向301并在htaccess中插入我下面代码的第一行时,一切正常。但对于类别和产品,htaccess将所有用户发送到一个不存在的页面上。读取prestashop URL中的所有这些参数时应使用哪些设置 #URL rewriting module activation RewriteEngine on Redirect 301 /contact-form.php http://sitoweb.eu/ Redirect 301 /category.php?id_
#URL rewriting module activation
RewriteEngine on
Redirect 301 /contact-form.php http://sitoweb.eu/
Redirect 301 /category.php?id_category=73 http://sitoweb.eu/
为了匹配查询字符串,您需要使用RewriteCond和RewriteRule,因为查询字符串不是重定向指令中匹配的一部分 请尝试以下方法:
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]
为了匹配查询字符串,您需要使用RewriteCond和RewriteRule,因为查询字符串不是重定向指令中匹配的一部分 请尝试以下方法:
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]