[英]htaccess redirect domain to https, subdomain with parameter to http
[英].htaccess redirect http and https subdomain to other domain
我有子域:subdomain.example.com
我想將http和https重定向到另一個域
http://subdomain.example.com --> https://subdomain.exampleNew.com
https://subdomain.example.com --> https://subdomain.exampleNew.com
有誰知道如何做到這一點?
目前我只有:
RewriteCond %{HTTP_HOST} ^subdomain.example.com$ [NC]
RewriteRule ^(.*)$ https://subdomain.exampleNew.com/$1 [R=301,L]
如果要保留http / https狀態,則需要先捕獲該狀態,然后將其作為%1
傳遞給規則。 請改用以下內容:
RewriteCond %{HTTPS}s ^on(s)|off
RewriteCond %{HTTP_HOST} ^subdomain.example.com$ [NC]
RewriteRule ^(.*)$ http%1://subdomain.exampleNew.com/$1 [R=301,L]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.