htaccess SSL – Updating Your htaccess for SSL

Once you’ve either purchased a premium SSL certificate or gotten a free SSL certificate from LetsEncrypt.com (either through their service directly or through your host as I detail in this video on how to make your WordPress site SSL compliant), you can enable SSL on your website in a number of different ways, most notably htaccess SSL.htaccess SSL

Here is the easy video explanation on how to get your website SSL compliant with htaccess SSL:

htaccess SSL Explanation

In the WordPress post I just linked to, I show how to automatically do it via a free plugin. Drupal has its own modules to do the same thing.

Perhaps the easiest way is the theme of this post, the htaccess SSL way. Or simply making an update to your .htaccess file on your host to include some code which tells browsers and search engines to point your website to the new secure HTTPS version of your website.

Just copy and paste the following code exactly into the rewrite section of your htaccess file. If you don’t already have an htaccess file on the root directory of your website, simply create a text file and name it .htaccess, then paste the following code exactly into that text file and save it:

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

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

 

Once that code is in your .htaccess file, this will send a signal to anyone who visits your website whether that be a search engine or an actual person’s browser that your site should reload over the HTTPS or the secure version of itself.

The code ensures that both the WWW and non-WWW versions of your website load the exact same way, so there’s no confusion or issues with that.

Make this simple switch and ensure that you are SSL compliant for the search engines and your visitors alike.

Scroll to Top