View Full Version : Redirect http page to https

09-21-2010, 11:24 AM
Hi all,

Just a quick one - would anyone know the correct htaccess code to redirect a register.php page from http to https? When the site isn't on the register.php page it should redirect back to http.

Many thanks.

Tony M
09-21-2010, 05:18 PM
to force HTTPS for a particular folder you can use:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} somefolder
RewriteRule ^(.*)$ https://www.domain.com/folder/$1 [R,L]
The .htaccess file should be placed in the folder where you need to force HTTPS.
You can see examples at: