If you want all visitors to a specific URL who arrive via HTTP to automatically be redirected to HTTPS, you can do so with the help of mod_rewrite. With mod_rewrite installed (most distributions install it by default with Apache, or at least offer it as a package) and enabled, a simple addition to your vhost configuration is all that is required. The following illustrates how a URL ending in /mail would be rewritten:
RewriteEngine on RewriteCond %{HTTPS} !^on$ [NC] RewriteRule . https://mydomain.net/mail[L]
Note that mod_ssl is also required buy you'll rarely find a binary install of Apache that doesn't include it.
0 comments:
Post a Comment