RHEL7: How to deal with HTTPS in WordPress.

Share this link

Presentation

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.

Configuration

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.

Additional Resources

You can read this page on How (And Why) To Disable WordPress XML-RPC or this blog post about RHEL 7 HTTPD SELinux policy hardening.
You can also read this article on How to run Ultra-Fast WordPress.

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

RHCSA7: Task of the day

Allowed time: 5 minutes.
Create two users "tom" and "engine". "tom" has the UID/GID 3000 and "engine" the UID/GID 4000. "engine" doesn't have an interactive shell.

RHCE7: Task of the day

Allowed time: 15 minutes.
Configure a httpd server with a password protected directory under the /var/www/html/private directory.

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 ...