【问题标题】:Specific Page Redirection to subdomain using .htaccess rule使用 .htaccess 规则将特定页面重定向到子域
【发布时间】:2016-11-10 15:35:42
【问题描述】:

我想使用 .htaccess 规则将特定页面网址仅重定向到子域
eg.-
http://www.domain.com/blog to http://blog.domain.com/

提前谢谢你。

【问题讨论】:

    标签: apache .htaccess mod-rewrite server


    【解决方案1】:

    试试:

    RewriteEngine on
    
    RewriteRule ^blog/$ http://blog.subdomain.com/ [L,R]
    

    【讨论】:

      【解决方案2】:

      使用这个:

      RewriteRule ^(blog/.*)$ http://blog.domain.com/$1 [R=301,L,NC]
      

      这将采用 www.domain.com/blog 并将其更改为 www.blog.domain.com

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2017-08-16
        • 1970-01-01
        • 2017-12-26
        • 2010-12-27
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多