Hi @devjourney:
You must first confirm that your SSL setup is correct. Let create a file hello.html
at your website’s document root with any text content, such as Hello world!
:
- echo 'Hello world!' | sudo tee -a /website/document/root/hello.html
Make it readable so your web server can read it:
- sudo chmod 644 /website/document/root/hello.html
Now, open this url in your browser: https://yourwebsite.com/hello.html
If you see the Hello world!
message, then your SSL setup is correct. If not, correct your SSL setup before moving on to the next step. Subsequently, finish this first step by deleting the hello.html
file:
- sudo rm /website/document/root/hello.html
Assuming that your SSL setup is correct, now switch your WordPress site from HTTP to HTTPS. Open your WordPress config file wp-config.php
in your favorite text editor. Then add the following two lines to that file, at any position above the line /* That's all, stop editing! Happy blogging. */
:
define( 'WP_SITEURL', 'https://yourwebsite.com' );
define( 'WP_HOME', 'https://yourwebsite.com' );
The above two lines force your WordPress to use HTTPS instead of HTTP without touching any WordPress Dashboard settings. Now you can open your WordPress site using the url https://yourwebsite.com/
instead of http://yourwebsite.com/
as before.
Regards,
Tom Nguyen