【问题标题】:.htaccess rules for old URLs to new Prestashop site do not redirect旧 URL 到新 Prestashop 站点的 .htaccess 规则不会重定向
【发布时间】:2013-10-17 18:15:13
【问题描述】:

我正在尝试将旧 URL 重定向到新的 Prestashop 站点,但找不到正确的方法。

旧结构是:

example.com/Shops/example.com/epages/

我想将所有内容重定向到域的根目录。我在根目录下 Prestashop 生成的 .htaccess 末尾添加了这个,没有成功。

Options +FollowSymLinks
RewriteEngine On
#RewriteCond %{REQUEST_URI} ^/Shops [NC]
#RewriteCond %{REQUEST_URI} ^/epages [NC]
RewriteRule ^epages/(.+)$ http://example.com [R=301,L]

【问题讨论】:

  • 这个问题似乎是题外话,因为它是关于 SEO

标签: .htaccess mod-rewrite prestashop-1.5


【解决方案1】:

使用此代码:

RewriteEngine On

RewriteRule ^(epages|Shops)/ http://my-domain.com/? [R=301,L,NC]

这会将任何以/epages//Shops/ 开头的旧URI 重定向到http://my-domain.com/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-08-07
    • 2015-10-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-14
    • 2015-09-14
    相关资源
    最近更新 更多