Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache 重定向301 htaccess prestashop_Apache_.htaccess_Mod Rewrite_Seo_Prestashop - Fatal编程技术网

Apache 重定向301 htaccess prestashop

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_

当为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_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]