From d7e230aea2abb30e681ecd51355faba8637f0cc1 Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Sun, 27 Dec 2009 18:08:02 -0500 Subject: Add redirect from HTTP to HTTPS. Ticket #63 --- etc/inc/system.inc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'etc/inc/system.inc') diff --git a/etc/inc/system.inc b/etc/inc/system.inc index f711a28..a26997e 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -840,14 +840,12 @@ server.network-backend = "writev" ## modules to load server.modules = ( {$captive_portal_module} - "mod_access", "mod_accesslog", "mod_expire", "mod_compress", + "mod_access", "mod_accesslog", "mod_expire", "mod_compress", "mod_redirect", {$module}{$captiveportal} ) ## Unused modules # "mod_setenv", - -# "mod_redirect", # "mod_rewrite", # "mod_ssi", # "mod_usertrack", @@ -862,7 +860,6 @@ server.modules = ( # "mod_evhost", # "mod_userdir", # "mod_cgi", -# "mod_accesslog" server.max-keep-alive-requests = 15 server.max-keep-alive-idle = 30 @@ -1026,6 +1023,16 @@ EOD; if($ca <> "") $lighty_config .= "ssl.ca-file = \"{$g['varetc_path']}/{$ca_location}\"\n\n"; } + + if ($config['system']['webgui']['protocol'] == "https" && !isset($config['system']['webgui']['disablehttpredirect'])) { + $lighty_config .= << "https://%1/$1" ) + } +} +EOD; + } $fd = fopen("{$filename}", "w"); if (!$fd) { -- cgit v1.1