【问题标题】:Rerouting old subdomain to new subdomain将旧子域重新路由到新子域
【发布时间】:2015-01-12 16:09:22
【问题描述】:

将站点迁移到新域后,子域不会重新路由。它应该从以下位置重新路由:

subdomain.oldsite.com

subdomain.newsite.com

我尝试了以下方法,但它不起作用:

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^subdomain.oldsite.comt$ 
RewriteRule (.*)$ http://subdomain.newsite.com/$1 [R=301,L]

有什么线索吗?

【问题讨论】:

  • 你有错字吗? ^subdomain.oldsite.comt$ 不行。

标签: apache .htaccess subdomain


【解决方案1】:

试试这个

RewriteEngine on
RewriteCond %{HTTP_HOST} ^subdomain\.oldsite\.com$ [NC]
RewriteRule ^(.*)$ http://subdomain.newsite.com/$1 [R=301,L]

【讨论】:

    猜你喜欢
    • 2021-07-09
    • 1970-01-01
    • 1970-01-01
    • 2020-02-29
    • 2021-04-14
    • 1970-01-01
    • 2018-10-09
    • 2012-09-05
    • 1970-01-01
    相关资源
    最近更新 更多