htaccess

Hi all,
my aim is to use htaccess to move all requests to https to http.
My question is this. Can this be done if the domain name does not have a secure certificate and if so then how.

This is what I have come up with but no luck
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Open in new window

Cheers,
N
LVL 5
Neil_BradleyWeb UX/UI DeveloperAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Dave BaldwinConnect With a Mentor Fixer of ProblemsCommented:
This will do it IF the site has a certificate.  If it doesn't have a certificate, the connection is never made so the re-write can't happen.  The HTTPS connection is made Before anything else.  No cert, no connection, no Rewrite.
RewriteEngine On
RewriteCond %{HTTPS} =on
RewriteRule ^ http://www.yoursite.com%{REQUEST_URI} [L,R=301]

Open in new window

0
 
Dave BaldwinFixer of ProblemsCommented:
The SSL/TLS security certificate is part of what provides the HTTPS encryption.  You can not use HTTPS without one.
0
 
Neil_BradleyWeb UX/UI DeveloperAuthor Commented:
Yes I know that but my question asks if it is possible to re direct any https requests to http?
0
 
Neil_BradleyWeb UX/UI DeveloperAuthor Commented:
Thanks Dave, I suspected as much but good to have, confirmation.
Cheers,
Neil
0
 
Dave BaldwinFixer of ProblemsCommented:
You're welcome.  I vaguely remembered trying that before so I re-did the experiment on two of my sites, one with SSL and one without, to make sure.
0
All Courses

From novice to tech pro — start learning today.