Htaccess help

I want to use https just for the login page. How do I make it go back to http after the user has logged in?

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^login.php [R=301,L]

this htaccess file checks if https is off. if it is, then redirect to the https version of the login(if the user gets to the login page). At least that’s what I think it does.

now after it logs in, it stays in https… how do I make it come out of it?


{HTTPS} is either on or null so your mod_rewrite should never match (in my signature’s tutorial, I recommend using the port).

Personally, I use a combination of mod_rewrite and PHP checks to ensure secure mode (when required) or just mod_rewrite when secure mode is not required.

How do you make a visitor return to HTTP from login? By using PHP’s header() command and using an absolute link to http://yadda.yadda, of course.