We have a web-based IMAP client running in a subdirectory on our mail server and I wanted to force all usage to be protected by SSL. Google turned up a lot of hits but none of them worked out of the box. Here’s the mod_rewrite snippet which is inside of a <VirtualHost> block:
[…]