开发者

How to get a whole Wordpress site to work over SSL?

开发者 https://www.devze.com 2023-01-08 20:07 出处:网络
We have a Wordpress website that has an SSL certificate for all non-www pages. So, we\'ve tried setting the Wordpress address URL to https://mydomain.com in the General Settings screen. The redirect w

We have a Wordpress website that has an SSL certificate for all non-www pages. So, we've tried setting the Wordpress address URL to https://mydomain.com in the General Settings screen. The redirect works if you try entering www.mydomain.com, but only after you accept the certificate on the untrusted connection. So it needs 开发者_JAVA技巧to run the redirect before it checks. It also doesn't seem to redirect if no 's' is added to the http, but I've found plugins that say they'll fix that, but nothing seems to fix my other problem.


Detailed explanation: http://noctis.de/archives/11-Using-WordPress-with-SSL.html :)

Maybe you need to add one more VirtualHost or to buy an wildcard certificate.

<VirtualHost my.ip:80>
    ServerName example.com
    ServerAlias www.example.com
    RedirectPermanent https://example.com
</VirtualHost>

Or try to add an .htaccess file:

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://example.com/$1 [R,L]

Source: http://www.besthostratings.com/articles/force-ssl-htaccess.html

0

精彩评论

暂无评论...
验证码 换一张
取 消