Redirect Entire Site From https:// To http:// Using .htaccess File

February 1st, 2013 - Posted by Steve Marks to Web Development.

For some reason, at the time of writing this post, Google has started to pick up a couple of ‘https’ versions of my pages. I’m not sure where this is being picked up from but I don’t require SSL encryption anywhere on my site. Due to this I wanted to rule out any chance of the https version being picked up and lock the site down to always use http.

I did this by updating the .htaccess file to include the following lines:

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

The above mod_rewrite checks if the connection is using SSL/TLS and, if it is, performs a 301 (ie. permanent) redirect to the http equivalent.

Go ahead, visit and take a look at the above .htaccess entries in action.

This entry was posted on Friday, February 1st, 2013 at 8:57 pm by +Steve Marks and is filed under Web Development. You can follow any responses to this entry through the RSS 2.0 feed.

Fear not, we won't publish this

Comments (3)
  1. Raju says:

    thank you, I lost my traffic after switching to https because backlinks juice

  2. @Abhishek – I think you’d still need a valid SSL certificate as the browser will check for this before it performs any redirects.

  3. Abhishek says:

    I used the same redirect rule but safari still shows cannot verify the website certificate.