![](/img/trans.png)
[英]Exclude specific subdomain or no subdomain in htaccess RewriteRule
[英].htaccess force https but exclude a subdomain
如何排除子域名被迫加入https并重定向到主网址? 我在我的.htaccess文件中使用了以下内容,但需要一些帮助,因为我的子域(stage.mydomain.com)被重定向/无法访问。
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
我尝试了几个选项,但没有运气 - 任何想法? 谢谢!
你有这样的第一条规则:
RewriteCond %{HTTP_HOST} !^stage\.mydomain\.com$ [NC]
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.