diff options
author | mh <mh@immerda.ch> | 2011-02-22 23:53:29 +0100 |
---|---|---|
committer | mh <mh@immerda.ch> | 2011-02-22 23:53:29 +0100 |
commit | 33c5ede6de31667d5f2a2797b1aab2d98db8a6ae (patch) | |
tree | e7598f791b412c6127e87571fcf0d12190d1c6b5 | |
parent | 420b74afaa1a222b3fc17c8bf91b2890aef3232d (diff) |
fixing mode stuff
-rw-r--r-- | templates/vhosts/default.erb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/templates/vhosts/default.erb b/templates/vhosts/default.erb index 4a7d7f4..172518c 100644 --- a/templates/vhosts/default.erb +++ b/templates/vhosts/default.erb @@ -1,4 +1,11 @@ -<%- [:normal,:ssl].each do |vhost_part| +<%- +vhost_parts = case ssl_mode + when 'only' then [:ssl] + when false then [:normal] + when 'false' then [:normal] + else [:normal,:ssl] +end +vhost_parts.each do |vhost_part| # we need this variable in included templates @vhost_part = vhost_part %> @@ -7,7 +14,7 @@ <%= scope.function_template('apache/vhosts/partials/header_default.erb') %> <%= scope.function_template('apache/vhosts/partials/logs.erb') %> - <%- if ssl_mode == 'force' && vhost_part == :ssl %> + <%- if ssl_mode == 'force' && vhost_part == :normal %> RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule (.*) https://%{SERVER_NAME}$1 [R=permanent,L] |