Blog

WordPress and SSL

Read Part 1 of this series on SSL: You Need SSL in 2019

SSL and WordPress

Once you’ve gotten your SSL certificate, you’ll need to make an edit to your WordPress install under Settings, and you need to change the http:// to https://. The hard part is making sure all of the links on your site update and you can verify that media files are all coming from a secured server too.  Chrome doesn’t like sending insecure images to secure websites.

Step 1: Change the URI in Settings

Under Settings > General, you’ll see the domain name your WordPress installation uses.  If it doesn’t already say https://, you’ll need to change it.

Step 1: Change the .htaccess file

The most intimidating part of the process is checking the .htaccess file. If you are comfortable doing that, then look for this:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Then add this in front of the WordPress stuff:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

It should now look like this:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

NOW, you should be able to type in http:// and it’ll redirect to https:// on the server level without causing 404s or other errors.

All standard caveats apply.  Backup first!  When I’m making changes, I change the name of the working file to .htaccess.bak then if the new .htaccess doesn’t work, I still have the original.  Seems like an obvious one, but reminders never hurt.

Share this article:

Norman Pemper - Lead Designer
I am a Boston-based graphic designer specializing in small business, political, financial, and real estate websites. My focus is creating clean, elegant designs utilizing WordPress and corresponding print materials, such as business cards, brochures, letterhead and more.

4 thoughts on “WordPress and SSL

Leave a Reply

Your email address will not be published. Required fields are marked *