Linux Manju

February 9, 2009

Apache http to https redirection

Filed under: FreeBSD, Linux — Tags: , , , , — admin @ 1:35 pm

I wanted to force all users to use https://mymailserver.com instead of http://mymailserver.com.

Open apache config file (   httpd.conf or apache2.conf  or sites-enabled/000-default  ?? )

Add these lines

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

/etc/init.d/apache2 restart

Powered by WordPress