Cloud Offer: 50% discount On the CLOUD and the VPS server on the first payment. Pay for as long term as possible to take the most benefit. Use Promo code: 50-OFF

Force folder to redirect to https mode Print

  • 124

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 ^(.*)$$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?

« Back