SSL on WordPress多站点 - 仅限一个站点

问题描述:

我在WordPress多站点的主站点上设置了SSL站点。我无法访问的子域名网站,因为它不具备SSL(并不需要它),而WordPress是重定向到https://SSL on WordPress多站点 - 仅限一个站点

这是我的htaccess代码:

# BEGIN rlrssslReallySimpleSSL rsssl_version[2.4.1] 
<IfModule mod_rewrite.c> 
RewriteEngine on 
RewriteCond %{HTTPS} !=on [NC] 
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] 
</IfModule> 
# END rlrssslReallySimpleSSL`enter code here` 

我已经试过了本文的建议,但它并没有为我工作:

https://really-simple-ssl.com/knowledge-base/preventing-subdomains-add-domains-getting-forced-https/

谢谢!

您的一行字:

RewriteCond %{HTTPS} !=on [NC] 

您将要添加的条件来限制它被重定向到https域,加入条件像

RewriteCond "%{REMOTE_HOST}" "^host1" [OR] 
RewriteCond "%{REMOTE_HOST}" "^www.host1" [OR] 
RewriteCond "%{REMOTE_HOST}" "^host2" 

加入多个域之后,你”你需要添加[OR]来匹配行或下一行,而不是试图匹配它们。 There is more information about the configuration of RewriteCond in the Apache HTTP Server documentation

+0

谢谢,但它不适合我的情况。你的答案与我上面发布的链接类似。 –