With Google’s announcement that sites that implement HTTPS or SSL will get a small ranking boost, most webmasters are jumping onto the news and switching their blogs and websites to serve https traffic.
We ourselves have switched to HTTPS. If you look in the browser’s url box, you’ll see that our pages begin with HTTPS in green letters. It’s very simple to switch over to https when using WordPress as your blogging platform.
In order to get your site switched over, you’ll first need to generate your server private SSL certificate key file. We blogged about it here if you don’t know how to do it.
Then you must also create a certificate signing request key file. This key will need to be submitted to the SSL certificate registrar or provider.
After registering for a SSL certificate and submitting your certificate signing request key, you’ll then be given a SSL certificate to install on your server.
The thing about installing the SSL certificate is you must also change the default port # that your web server communicates over. By default it’s port 80 for web traffic.
You must change it to port 443 and redirect all traffic coming over to port # 80 to # 443.
There are many good tutorials on this that will show you how to do it over Apache or Nginx and other web servers. If you’re running Nginx, here’s how do accomplished ours.
If you’re running a WordPress blog and you change the default web server port # to 443, you’ll notice that all your permalinks will not be updated. Accessing your pages will result in 404 errors which means the pages can’t be found.
To update the permalinks in WordPress, you must update the link data in its database. We did the same and it worked for us. For this to work, you must have root access to your server database and know how to run these SQL statements.
An easier way is to install phpMyAdmin and update your database via a web browser. But not everyone wants to install additional tools on their critical server.
So, if you have root access to your web server, run the commands below to access your database server. Since must Linux systems run either MySQL or MariaDB server, the commands below should work on these database servers.
- Changing WordPress Home URL and Site URL via MySQL database.
To change WordPress Permalinks using MySQL database, run the commands below to logon to the database.
mysql -u root -p
You’ll be prompted for the root password. Type it to continue.
Next, run the SQL statement below to change to your production database. Please make sure you backup your database before attempting changes to it.
Without a good back and you mess up using these SQL statement, you may render you site inoperable.
use Database_name; (change Database_name to your database)
Next, run the commands below to view your current home URL stored in the database
SELECT * FROM wp_options WHERE option_name = 'home';
You’ll see something like this
MariaDB [lgdb01]> select * from wp_options where option_name = ‘home’;
| option_id | option_name | option_value | autoload |
| 39 | home | https://www.liberiangeek.net | yes |
1 row in set (0.00 sec)
Now to update your URL from HTTP to HTTPS, run the statement below. (replace liberiangeek.net to your website URL)
UPDATE wp_options SET option_value="https://www.liberiangeek.net" WHERE option_name = "home";
Next, run the statement below to view your current SiteURL .
SELECT * FROM wp_options WHERE option_name = 'siteurl';
Then run the commands below to change the SiteURL to https.
UPDATE wp_options SET option_value="https://www.liberiangeek.net" WHERE option_name = "siteurl";
Once the above changes have been made, you should be able to access the admin page as well as your post links provided the SSL and the web server port # change were corrected installed.
That’s it! Hope your site is working