Showing posts with label How to redirect non ssl (http links) traffic to SSL (https links). Show all posts
Showing posts with label How to redirect non ssl (http links) traffic to SSL (https links). Show all posts

How to redirect non ssl (http links) traffic to SSL (https links)

0 comments
Our Level I techs often gets tickets like how to make http:// or http://www. redirect to https:// or https://www. Often the answer is simple, but for the newbies and yours use, I am putting it here.

First requirement is to have an SSL certificate installed. Add the following lines in a .htaccess file:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

I assume when you directly access https://www.domainname.com , the site loads fine.