admin管理员组文章数量:1203411
I installed MultiSite with the URL set as , but now I want to force all requests to go over HTTPS, so I'm trying to change the URL to be . I've gone through the database and updated all the siteurl
and home
values to have https, but the site still loads over HTTP, instead of being redirected to HTTPS.
I know that I could setup some htaccess rules, but that's prone to errors. In regular installations WordPress will automatically redirect all requests to the canonical URLS defined in the siteurl
and home
settings, so I'm assuming that MultiSite does too.
I installed MultiSite with the URL set as http://example.com, but now I want to force all requests to go over HTTPS, so I'm trying to change the URL to be https://example.com. I've gone through the database and updated all the siteurl
and home
values to have https, but the site still loads over HTTP, instead of being redirected to HTTPS.
I know that I could setup some htaccess rules, but that's prone to errors. In regular installations WordPress will automatically redirect all requests to the canonical URLS defined in the siteurl
and home
settings, so I'm assuming that MultiSite does too.
3 Answers
Reset to default 2There are plugins to set the site to SSL. Why not use one of them?
And you do have an SSL certificate installed and active?
I encountered the same issue: with WordPress multisite, there is no option or setting that defines if a site domain is HTTP or HTTPS. Even after replacing all occurrences in the database, a site visitor can still enter and navigate the site in HTTP, without being redirected to HTTPS.
The following simple solution worked for me: I added this mod_rewrite
rule to my .htaccess file, just before the WordPress specific rewrite rules.
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Since this rule isn't defining a specific domain, it's perfect for the needs of WordPress multisite.
I found this rule in the following thread: https://stackoverflow.com/questions/4398951/force-ssl-https-using-htaccess-and-mod-rewrite
I changed the rules specific to a host. But now redirects all other blogs to this one. Changed to "%{HTTP_HOST}" to a specific domain and kept the "%{REQUEST_URI}" part.
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://gezentiyiz.biz%{REQUEST_URI} [L,R=301]
IMHO adding additional RewriteRule lines for other domains may solve the problem but I wonder is there any easy way to do it. Because each time a blog site is created we need to modifiy the .htaccess file???
Edit: I solved the problem changing the RewriteRule like this:
RewriteRule http://gezentiyiz.biz%{REQUEST_URI} https://gezentiyiz.biz%{REQUEST_URI} [L,R=301]
本文标签: sslSwitching MultiSite installation from HTTP to HTTPS
版权声明:本文标题:ssl - Switching MultiSite installation from HTTP to HTTPS 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738653650a2105019.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论