【问题标题】:Redirect 301 htaccess prestashop重定向 301 htaccess prestashop
【发布时间】:2016-02-21 00:27:28
【问题描述】:

当为 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/

【问题讨论】:

    标签: apache .htaccess mod-rewrite seo prestashop


    【解决方案1】:

    要匹配查询字符串,您需要使用 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]
    

    【讨论】:

      猜你喜欢
      • 2011-05-01
      • 2011-01-03
      • 2012-03-10
      • 2021-07-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多