diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2012-05-25 11:21:26 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2012-05-25 11:21:26 -0300 |
commit | b9aa3c0d2d3cc594f57a6a02828f11c650657b3a (patch) | |
tree | f297c7d91ce6ef541bced85d580fefe3dbe85d1e | |
parent | 497082ae8f6811ba98a92a16e26073d8f13557f5 (diff) | |
download | puppet-apache-b9aa3c0d2d3cc594f57a6a02828f11c650657b3a.tar.gz puppet-apache-b9aa3c0d2d3cc594f57a6a02828f11c650657b3a.tar.bz2 |
Adding support for canonical_exceptions
-rw-r--r-- | manifests/init.pp | 2 | ||||
-rw-r--r-- | templates/site.erb | 3 |
2 files changed, 4 insertions, 1 deletions
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 @@ </IfModule> <% 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] |