强制使用主域和 www.但不是子域
forcing https with primary domain & www. but NOT subdomains
我安装了域和 SSL 证书。这不是通配符 SSL。
我们有一个第三方 url 重写托管在他们服务上的其中一个子域 - 这是我无法摆脱或控制的。
他们在子域上没有 SSL。现在我已经安装了 SSL,子域也总是重定向到 https,这会引发错误。
我希望子域转到 http 而主域只转到 https。
我的 htaccess 中最初有以下内容:
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
我已经删除了这个,所有内容仍然指向 https。
We have a third-party url rewrite for one of the subdomains that is
hosted on their services
这是在您的 .htaccess 文件之外进行的操作吗?这个第 3 方重写可能是导致问题的原因。
但是,如果您只想忽略子域,只需将其添加到规则中即可。
RewriteEngine on
RewriteCond %{HTTPS} !^on
RewriteCond %{HTTP_HOST} !^subdomain\.example\.com [NC]
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
我安装了域和 SSL 证书。这不是通配符 SSL。
我们有一个第三方 url 重写托管在他们服务上的其中一个子域 - 这是我无法摆脱或控制的。
他们在子域上没有 SSL。现在我已经安装了 SSL,子域也总是重定向到 https,这会引发错误。
我希望子域转到 http 而主域只转到 https。
我的 htaccess 中最初有以下内容:
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
我已经删除了这个,所有内容仍然指向 https。
We have a third-party url rewrite for one of the subdomains that is hosted on their services
这是在您的 .htaccess 文件之外进行的操作吗?这个第 3 方重写可能是导致问题的原因。
但是,如果您只想忽略子域,只需将其添加到规则中即可。
RewriteEngine on
RewriteCond %{HTTPS} !^on
RewriteCond %{HTTP_HOST} !^subdomain\.example\.com [NC]
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]