|
Sometimes it's nice to be able to automatically redirect pages or directories over to the SSL sencrypted page for things like logins and credit card information. With Apache it's a very easy process with mod_rewrite. Here is example code for redirecting an HTTP website to an SSL website using Apache's mod_rewrite...
Add everything in between the quotes to an .htaccess file in the directory to protect on your Apache server. This works on Apache for UNIX and Apache for Windows. " RewriteEngine On RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R] " |