2016-11-30 71 views
0

我在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/

謝謝!

回答

1

您的一行字:

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

謝謝,但它不適合我的情況。你的答案與我上面發佈的鏈接類似。 –