# Rewrite Rules. RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^/webmail/(.*) https://%%7BSERVER_NAME%7D/webmail/$1 [R,L] RewriteRule ^/mailman/(.*) https://%%7BSERVER_NAME%7D/mailman/$1 [R,L]
#Debug rewrite rules RewriteLog /etc/httpd/logs/rewrite_engine_log RewriteLogLevel 3
The idea is to take any URL under /webmail or /mailman and redirect it to https, so that, for example,
http://www.concretecomputing.com/webmail/
gets redirected to the same page, but using https. It doesn't happen.
<VirtualHost 192.168.1.46:80> ServerName localhost DocumentRoot /var/www/html DirectoryIndex index.html index.shtml RewriteEngine on RewriteCond %{SERVER_PORT} ^80$ RewriteRule ^/webmail(.*)$ https://192.168.1.46/webmail$1 [L,R] RewriteLog "/var/log/httpd/rewrite.log" RewriteLogLevel 4 </VirtualHost>
Replace ipaddress either with the fqdn or with the ipaddress of your machine.
I am also attaching the ssl.sxw file in which how to generate certiticates for http.
Regards
Ankush Grover