【问题标题】:Redirecting Subdomain to HTTPS WWW URL using Apache Virtual Host使用 Apache 虚拟主机将子域重定向到 HTTPS WWW URL
【发布时间】:2017-04-24 05:09:55
【问题描述】:

我想知道如何将 HTTP 和 HTTPS 的子域重定向到特定 URL。

我希望它来自:

http://test.example.com to https://www.example.com/test

https://test.example/com to https://www.example.com/test

【问题讨论】:

    标签: php apache redirect


    【解决方案1】:

    希望这会对您有所帮助,因为它对我有用。

    Check this .htaccess code here

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ([a-z]+)\.(example\.com) #checking domain and subdomain
    RewriteRule ^(.*)$ https://www.%2/%1 [R=301,L] #redirecting
    

    【讨论】:

      猜你喜欢
      • 2018-12-06
      • 2016-07-16
      • 2017-09-13
      • 2017-01-11
      • 2018-06-01
      • 2018-06-02
      • 2020-05-08
      • 1970-01-01
      • 2014-01-08
      相关资源
      最近更新 更多