How force a directory into https://

  • Secure-yourself

The following is easy:

Add the following lines to  .htaccess file inside a directory you will need to secure:

RewriteEngine on
#Options +FollowSymlinks
RewriteCond %{SERVER_PORT} ^80$
RewriteRule ^(.*) https://yourdomain.com/directory/$1 [R,L]

where yourdomain.com/directory is the directory you need to secure.
All http requests within this directory will be forced to go to https.

I found a very useful tool to check unsecure contents in https page:
http://www.whynopadlock.com/

Categories

About the Author: