Page 1 of 1

.htaccess for rewriting https to http

Posted: Sun Dec 03, 2006 9:56 am
by saibot1
I don't have SSL installed but sometimes people try to access my site through https and the following error shows up. How can I redirect everyone from https://www.mysite.com to http://www.mysite.com ? I tried the following 2 codes but they don't work.

http://www.mysite.com has sent an incorrect or unexpected message. Error code: -12263

Code: Select all

RewriteCond %{SERVER_PORT} 443
RewriteRule (.*) http://www.mysite.com/$1 [R]

Code: Select all

RewriteEngine on

RewriteCond %{HTTP_HOST} ^https://www.mysite.com [NC]
RewriteRule ^(.*)$ http://www.mysite.com/$1 [L,R=301]

Posted: Sun Dec 03, 2006 10:02 am
by feyd
Shouldn't the first snippet's condition be if it is port 443?