Try adding the following line after the "^443$" line:
Code:
RewriteCond %{HTTPS} =on
So you would have:
Code:
RewriteCond %{SERVER_PORT} ^443$ [OR]
RewriteCond %{HTTPS} =on
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [R=301,L]
Also note the [OR] at the end of the first line in that part.
But as it goes, what you posted first should be just fine without the extra bit I added for you.
Also you can use either of the below to make single pages stay as https:
.htaccess (you may need to remove the "=" before the on in the above code for this bit, and this goes directly after the "=on" line):
Code:
RewriteCond %{REQUEST_URI} !^/secure-page.php$ [NC]
php code to place on individual site pages:
Code:
<?php
if ( !$_SERVER['HTTPS'] )
{
$host = $_SERVER['HTTP_HOST'];
$request_uri = $_SERVER['REQUEST_URI'];
$good_url = "https://" . $host . $request_uri;
header( "HTTP/1.1 301 Moved Permanently" );
header( "Location: $good_url" );
exit;
}
?>
Note this should be right at the top of the page, before any other code!
I got this code from different source some time ago and have them all documented in a master htaccess file, so if you ever need it just give me a shout