0
我是一個在htaccess領域的初學者。從htaccess重定向排除子域。但重定向非www到www然後到https爲主域
我有以下規則現在
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
這可以幫助我實現以下
example.com => https://www.example.com
但是,我需要排除的子域:
subdomain.example.com/myfile.html => http://subdomain.example.com/myfile.html
哪有我達到了嗎?
在此先感謝您的答案。 注意:我嘗試了一些提供的解決方案。但他們都沒有爲我工作。