New answers tagged

0

Add this rule to the top of .htaccess: # BEGIN Force SSL # This should be the first rule before other rules <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L] </IfModule> # END Force SSL This should be before WordPress' rules.


-1

I've used Really Simple SSL to my all of clients sites and it works very fine. If you dont want to modify code, simply install this plugin and config it.


1

You can replace your URLs in PHPMyAdmin instead - make sure you have backed up your database though. You'd need to change this code and run it: UPDATE wp_posts SET guid = replace(guid, 'http://www.old-url.co.uk','https://www.new-url.co.uk'); UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-url.co.uk', 'https://www.new-url.co.uk'); ...


0

This can also happen if WordPress is hosted behind a reverse proxy that provides SSL. Paste the following in your theme's functions.php: define('FORCE_SSL_ADMIN', true); // a comma-separated list e.g. http,https if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false) $_SERVER['HTTPS']='on';



Top 50 recent answers are included