【问题标题】:Redirecting URLs that have 2nd url appended重定向附加了第二个 url 的 URL
【发布时间】:2017-07-06 16:57:22
【问题描述】:

根据我们的 SEO 人员的说法,我们在如下 URL 处获得流量:

http://www.oursite.com/articles/article1/www.someothersite.com/page.aspx/sectionID%20=113/

我想 301 重定向到 http://www.oursite.com/articles/article1(删除多余的 URL)。在 .htaccess 中试过这个:

RedirectMatch 301 ^http://www.oursite.com/articles/article1/www.someothersite.com/page.aspx/sectionID%20=113/$ /articles/article1

哪个不工作...

【问题讨论】:

  • http://www.oursite.com/articles/article1/www.someothersite.com/page.aspx/sectionID%20=113/ 应该重定向到什么地方?

标签: php apache .htaccess redirect


【解决方案1】:

您可以在站点根目录 .htaccess 中使用此重定向规则:

RedirectMatch 301 /(.+)/www\.someothersite\.com/.*$ /$1

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-06-28
    • 2015-04-24
    • 2012-12-16
    • 2021-12-27
    • 1970-01-01
    • 2020-02-19
    • 2012-03-19
    • 2017-05-12
    相关资源
    最近更新 更多