HTTPS to HTTP redirect

Sep 17, 2007 at 8:06 PM
Edited Sep 17, 2007 at 8:17 PM
Web site has been SSL secured (HTTPS) for many years due to a facility on the site for customers to retrieve data. This feature has recently been outsourced, so our site will be nothing but some static pages. The powers that be have decided not to spend the money to renew the SSL cert, so the site is going to HTTP.

Given that the entire site was HTTPS for many years, I'm going under the assumption that most of our clients have saved bookmarks/favorites of many of the sites pages which will cease to work once I turn SSL off. The site is now very simple, comprised of about 15 asp and 2 html pages, hosted on IIS5. I came across this project while searching for a solution.

If a customer tries to access a page on the site using HTTPS, I'm looking for them to be redirected to the same page, but through HTTP.

Here's my question: Would this work as a filter rule:

RewriteCond %HTTPS (?!on).*
RewriteCond %HTTP_HOST ^www\.website\.com$
RewriteRule %HTTPS (?!off).* R
Sep 18, 2007 at 4:10 PM
Been playing with this a bit and I have it partially working.

RewriteCond %{HTTPS} (?:on).*
#RewriteCond %{HTTP:Host} ^www\.website\.com$ I
RewriteRule ^/(.*)$ http://www.website.com/$1 I,R=301

This works, but definately not as granular as I'd like it to be. I've tried quite a few variations in the second condition, but to this point, can't get it to match. Would definately like for the Rule to just replace the https with http and not have to specify the www.website.com portion if possible. Any assistance would be great.

Thanks.