RHEL7: How to deal with HTTPS in WordPress.

Share this link


If you are about to migrate to HTTPS, there are some steps to follow to adapt your WordPress configuration.
Let’s assume that your website is called http://www.example.com and is stored in the /var/www/html/example directory.


You need to apply the following SQL requests on your WordPress database:

UPDATE as_options SET option_value=replace(option_value,'http://www.example.com','https://www.example.com') \ 
  WHERE option_name='home' OR option_name='siteurl';
UPDATE as_posts SET guid=replace(guid,'http://www.example.com','https://www.example.com');
UPDATE as_posts SET post_content=replace(post_content,'http://www.example.com','https://www.example.com');
UPDATE as_postmeta SET meta_value=REPLACE(meta_value,'http://www.example.com','https://www.example.com');

You also need to update the configuration in your WordPress Settings/General menu:

WordPress Address (URL): https://www.example.com
Site Address (URL): https://www.example.com

You should also force the website administration in https. Paste the following line in the /var/www/html/example/wp-config.php file:

define( 'FORCE_SSL_ADMIN', true );

Source: Inspired by Bram van Damme’s website.

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)

RHCSA7: Task of the day

Allowed time: 10 minutes.
Boot and change the root password before the end of the boot process.

RHCE7: Task of the day

Allowed time: 3 minutes.
Configure your machine to be a router.

Poll for favorite RHEL 7 book

What is your favorite RHEL 7 book to prepare RHCSA & RHCE exams?

View Results

Loading ... Loading ...

Poll for most difficult RHCSA 7 topic

What do you think is the most difficult RHCSA 7 topic?

View Results

Loading ... Loading ...

Poll for most difficult RHCE 7 topic

What do you think is the most difficult RHCE 7 topic?

View Results

Loading ... Loading ...

Recent Comments