?
Solved

htaccess

Posted on 2014-03-31
5
Medium Priority
?
293 Views
Last Modified: 2014-03-31
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
0
Comment
Question by:Neil_Bradley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39967957
The SSL/TLS security certificate is part of what provides the HTTPS encryption.  You can not use HTTPS without one.
0
 
LVL 5

Author Comment

by:Neil_Bradley
ID: 39967973
Yes I know that but my question asks if it is possible to re direct any https requests to http?
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 2000 total points
ID: 39967994
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
 
LVL 5

Author Closing Comment

by:Neil_Bradley
ID: 39968146
Thanks Dave, I suspected as much but good to have, confirmation.
Cheers,
Neil
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39968175
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

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question