Solved

htaccess

Posted on 2014-03-31
5
282 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
  • 3
  • 2
5 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
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
Comment Utility
Yes I know that but my question asks if it is possible to re direct any https requests to http?
0
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
Comment Utility
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
Comment Utility
Thanks Dave, I suspected as much but good to have, confirmation.
Cheers,
Neil
0
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now