How to force SSL with .htaccess

Making sure your site is using SSL is important. Below are some simple lines of code to add to nearly any site to get it to redirect. Rememeber that setting this redirect within your site, likely means that it is using php for the redirect. Adding a redirect in php can slow your site down, where as the apache or nginx redirect will be much faster. 

 

You can force an HTTPS connection on sites that run on a server that uses Apache, by adding these rules to the top of the .htaccess file:

If your server uses Nginx, add this to the top of the configuration file:
server {
       listen         80;
       server_name    siteex1.com siteex2.com;
       return         301 https://$host$request_uri;
}

If you are using WordPress, you may want to use a plugin instead. These plugins can be found using your favorite search engine, An example plugin is Really Simple SSL.

 

If using WordPress, once you have the SSL redirection enabled, you will need to have a developer update the code if you are getting mixed content errors. You may also be able to use a plugin such as Velvet Blues to change all of your site URL’s in the database.

 

If any issues arise, our support is available 24/7 for assistance! Just open a chat or ticket for help.