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
哪有我达到了吗?
在此先感谢您的答案。 注意:我尝试了一些提供的解决方案。但他们都没有为我工作。