Template:egRewriteNonSsl

From RaySoft

Syntax

{{egRewriteNonSsl}}

Usage

Code

{{egRewriteNonSsl}}

Result

Redirect all HTTP traffic to HTTPS
LoadModule   ssl_module       modules/mod_ssl.so
LoadModule   rewrite_module   modules/mod_rewrite.so
RewriteEngine on
RewriteCond   %{HTTPS} !=on
RewriteRule   .* https://%{SERVER_NAME}%{REQUEST_URI} [redirect=permanent,last]