【问题标题】:How to configure 301 redirect如何配置 301 重定向
【发布时间】:2016-05-06 12:24:30
【问题描述】:

如果我想将我的旧商店域 http://shop.example.net/product-name.html 重定向到 http://example.net/product-category/product-new-name

我该怎么办?

已经在做

Redirect 301 /Hoodies_c_70.html http://example.net/product-category/apparel/hoodies/

但它不起作用。它显示http://example.net/Hoodies_c_70.html

【问题讨论】:

  • 您需要重定向 Hoodies_c_70.html 页面还是所有域?我的意思是你想将 site.com/dir/dir/ 重定向到 newsite.com/newdir/newdir ?

标签: .htaccess url-redirection


【解决方案1】:

我找到了解决方案。问题发生在 .htaccess 中这一行的 bcoz:

Redirect 301 / http://example.com/store

所以我在 htaccess 中删除了那个并没有改变其他重定向。然后用代码添加一个 index.php 文件

header("Location: http://example.com/store/", true, 301);

现在一切都很好。

【讨论】:

    猜你喜欢
    • 2010-12-25
    • 1970-01-01
    • 2013-10-03
    • 2011-11-13
    • 2015-05-05
    • 2016-03-25
    • 1970-01-01
    • 2020-01-21
    • 2019-04-30
    相关资源
    最近更新 更多