【问题标题】:redirecting a subdomain to a domain using htaccess使用 htaccess 将子域重定向到域
【发布时间】:2013-01-07 12:00:52
【问题描述】:

我想将子域重定向到其主域中的文件夹。
子域是 blog.mydomain.com 我想把它重定向到http://www.mydomain.com/blog

我尝试使用如下的 htaccess 文件执行此操作:

RewriteEngine on
Options +FollowSymlinks -MultiViews

RewriteCond %{SERVER_PORT} =80
RewriteCond 5{HTTP-HOST} ^blog.mydomain.com$ [NC]
RewriteRule ^(.*)$ /blog/$1 [PT,L]

但它不起作用(重定向不会发生)。

有人知道我该怎么做吗?

谢谢。

【问题讨论】:

    标签: redirect subdomain


    【解决方案1】:

    试试

    Redirect 301 / http://www.mydomain.com/blog
    

    如果这样不行,我会尝试其他方法

    【讨论】:

      猜你喜欢
      • 2014-08-19
      • 2023-03-09
      • 2011-08-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-18
      • 2012-05-19
      相关资源
      最近更新 更多