Solved

htaccess

Posted on 2014-03-31
5
287 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 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 500 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How do Apache, PHP, and MySQL All Work Together? 6 87
IPA - can it be run on a web server? 3 177
RewrteRule using htacess 10 70
Apache Issues 9 80
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

772 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