0
我想知道如何将HTTP & HTTPS的子域重定向到特定的URL。使用Apache虚拟主机将子域重定向到HTTPS WWW URL
我希望它从去:
http://test.example.com to https://www.example.com/test
和
https://test.example/com to https://www.example.com/test
我想知道如何将HTTP & HTTPS的子域重定向到特定的URL。使用Apache虚拟主机将子域重定向到HTTPS WWW 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