Looking to Build/Redesign a Website or Blog ?

To speak to Rakshit, call +91 968 704 2303

[.htaccess] Redirect http to https using htaccess

Hello Friends,

I was working with one barter site. Client wants SSL for whole site. We installed it and all working fine with https. But as we were working since last 2 months and client have website url in his browser cache, client opening site with http and he is saying that ssl is not installed. lol..

Once i understand it, it should redirect http to https as visitors may not be aware that its https or http. so we must force in such a way that it redirect http to https if someone open with http. Here are the easy rule to redirect http to https using apache .htaccess rewrite rules.

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

Put above code in .htaccess file and upload it to your root folder. Redirect http to https using htaccess rules. Isnt it easy to redirect http to https using htaccess ? Share with your friends and let them aware if they are not.


1 Comment

Leave a Reply

Your email address will not be published.