Apache “tweaking”

As a true fan of mod_ssl I wanted to “convert” my webmail instances from http to https. The easiest way was to set it like this:


<Location "/webmail">
SSLRequireSSL
</Location>

But that was a bit problematic because when someone went to the old http://koko.foo/webmail he was presented with an error. It was time for my other favorite apache module…mod_rewrite
So I deleted the previous code and added the next piece of code inside the virtual host directive:


RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/webmail(.*) https://%{SERVER_NAME}/webmail$1 [R,L]

I also splitted the webdav configuration part (like I have done with ssl) because the httpd.conf was getting larger and larger, and it was already difficult to browse it and edit it.

That’s it for now…I am going to play a bit of Doom3 and then read a couple of pages from Da Vinci Code book I’ve bought.