To move an existing WordPress to secure SSL/HTTPS

It’s easy to get you existing WordPress installation to secure SSL/HTTP.

I think you know how to prepare the server or you isp do, else use Google.

Now to WordPress, there are tree step:

1. The settings in General: Configure-HTTPS-for-WordPress[1]





2. wp-config.php:
Write this in wp-config.php

define('FORCE_SSL_LOGIN', true);

Now you WordPress is on SSL but the HTTPS is broken. Forget Google it is not the templates fault, and forget plugin’s or rewrite – it kills the cat. The problem is all you old stuff, stored in the database. It’s full of http:// ‘s

3. Tweak you database, (backup is a good thing here):

The table YOUPREFIX_posts is full of ‘http://YOU_URI’. We are going to change them to ‘https://YOU_URI.

There are two columns: post_content and guid – Run these two sql updates

sql = UPDATE `YOUPREFIX_posts` SET `post_content` = REPLACE(`post_content`, 'http://YOU_URI', 'https://YOU_URI') WHERE `post_content` LIKE '%http://YOU_URI%';
sql = UPDATE `YOUPREFIX_posts` SET `guid` = REPLACE(`guid`, 'http://YOU_URI', 'https://YOU_URI') WHERE `guid` LIKE '%http://YOU_URI%';

You need YOU_URI or you break external links.

Maybe there are other tables e.g. Comments, I don’t use them, but it’s the same rumble as above.

And now you fly – or not. You probably have more than one plugins there is broken. You have to edit them or retire them. Often they is calling home for images and that break the HTTPS chain.

New stuff you put up is automatic made as https.

Print Friendly, PDF & Email

Skriv et svar