Portal Home > Knowledgebase > .htaccess > Force folder to redirect to https mode.


Force folder to redirect to https mode.




Sometimes webmasters need to force particular folders to load in HTTPS mode.  This is ideal for management of a back end of a shopping cart, or a forum or other scripts where sensitive information may reside.

Just create an .htaccess in the folder "yourfolder" for example, and enter the following in the .htaccess file:

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} yourfolder
RewriteRule ^(.*)$ https://www.yourdomain.com/yourfolder/$1 [R,L]

This will redirect users to the HTTPS version of that folder rather than allowing them to load up in HTTP mode.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read

Powered by WHMCompleteSolution