From b9aa3c0d2d3cc594f57a6a02828f11c650657b3a Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Fri, 25 May 2012 11:21:26 -0300 Subject: Adding support for canonical_exceptions --- manifests/init.pp | 2 +- templates/site.erb | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index 6b7b382..9e9f43f 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -191,7 +191,7 @@ class apache { $comment = '', $sshkey = absent, $groups = '', $shell = '/bin/false', $manage_user = true, $ssl = false, $listen = '*', $https_redirect = false, - $canonical = false) { + $canonical = false, $canonical_exceptions = '') { $vhost = $filename ? { '' => "$title", diff --git a/templates/site.erb b/templates/site.erb index 586b158..911d97a 100644 --- a/templates/site.erb +++ b/templates/site.erb @@ -26,6 +26,9 @@ <% end %> <% if canonical != false %> + <%- for canonical_exception in canonical_exceptions -%> + RewriteCond %{HTTP_HOST} !=<%= canonical_exception %> [NC] + <%- end -%> RewriteCond %{HTTP_HOST} !=<%= canonical %> [NC] RewriteCond %{HTTP_HOST} !="" RewriteRule ^/(.*) <%= protocol %>://<%= canonical %>/$1 [L,R=301] -- cgit v1.2.3