On Apr 6, 2006, at 7:37 AM, Corrado 'Fizban' Ignoti wrote:

On Thu, 6 Apr 2006 10:19:04 -0500, phil <[EMAIL PROTECTED]> wrote:
You need to have that mod_rewrite vodoo running on Apache for this to
work, but work it does.
I'm wondering about IIS users.
Is there a thing similar to mod_rewrite to force https connections?


Another approach is to not use mod_rewrite to enforce https. I simply setup two virtual servers, one on 80 and one on 443, then redirect any request from http -> https. As such:

-----------------------------------------
NameVirtualHost 192.168.2.1:80
NameVirtualHost 192.168.2.1:443

# Redirect webmail requests to ssl
<VirtualHost 192.168.2.1:80>
   ServerName webmail.myhost.org
   RedirectPermanent / https://webmail.myhost.org/
</VirtualHost>

# Serve webmail requests
<VirtualHost 192.168.2.1:443>
   SSLEngine on
   ServerName webmail.myhost.org
   ...
</VirtualHost>
-----------------------------------------

The same approach will easily work for IIS.

Ethan


Reply via email to