Oct 05 2010

Force HTTPS Redirect in Apache

Published by at 11:39 pm under Apache

Configure Apache to redirect HTTP requests to HTTPS protocol. This can be achieved with mod_rewrite.

LoadModule rewrite_module modules/mod_rewrite.so

RewriteEngine on
# Activates Rewrite log
RewriteLog "C:\Apache\logs\rewrite.log"
RewriteLogLevel 1

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

RewriteCond %{HTTPS} off filters incoming requests which protocol isn’t HTTPS.

No responses yet

Comments RSS

Leave a Reply