【发布时间】: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
【问题讨论】:
我想知道如何将 HTTP 和 HTTPS 的子域重定向到特定 URL。
我希望它来自:
http://test.example.com to https://www.example.com/test
和
https://test.example/com to https://www.example.com/test
【问题讨论】:
希望这会对您有所帮助,因为它对我有用。
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
【讨论】: