.htaccess for rewriting https to http

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
saibot1
Forum Newbie
Posts: 8
Joined: Sat Nov 25, 2006 9:13 pm

.htaccess for rewriting https to http

Post 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]
Last edited by saibot1 on Wed Dec 06, 2006 6:47 am, edited 2 times in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Shouldn't the first snippet's condition be if it is port 443?
Post Reply