我想知道如何重定向http&https到特定的URL。
我希望它来自:
http://test.example.com to https://www.example.com/test
和
https://test.example/com to https://www.example.com/test
希望这对我有用时会有所帮助。
在此处检查此.htaccess代码
RewriteEngine on
RewriteCond %{HTTP_HOST} ([a-z]+).(example.com) #checking domain and subdomain
RewriteRule ^(.*)$ https://www.%2/%1 [R=301,L] #redirecting