Apache Rewrite tips
A few tricks and tips when using apache rewrites
Force a specific file to use SSL
You can force a specific page in your web folder to force itself to be SSL encrypted. For example, you might want to do this when you have a form where you want people to submit personal data (userID, credit card #, etc.) and you want to provide an extra layer of security. One way to do this is with a .htaccess file and Apache's mod_rewrite.
Let's assume you have a form with a file name 'registration.html' and the URL of that page on your site is '/dir/path/registration.html'. To secure it, create a '.htaccess' file in the directory where the form exists, and include the following in the file:
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^registration.html https://%{SERVER_NAME}/dir/path/registration.html [R,L]
If you go to your page, it should automatically rewrite to the SSL encrypted 'https' URL.

