diff options
author | Nicolas Vigier <boklm@mageia.org> | 2013-05-23 15:07:42 +0000 |
---|---|---|
committer | Nicolas Vigier <boklm@mageia.org> | 2013-05-23 15:07:42 +0000 |
commit | 9459f8fad296bea99dd9bccabb337a2dc3bdb4a8 (patch) | |
tree | 04ba704ec7186858100856b6868c3f5bb5af7cc0 /modules/apache/templates | |
parent | c82d2d6bb1571c3f9058e8c52fa83831cfbea360 (diff) | |
download | puppet-9459f8fad296bea99dd9bccabb337a2dc3bdb4a8.tar puppet-9459f8fad296bea99dd9bccabb337a2dc3bdb4a8.tar.gz puppet-9459f8fad296bea99dd9bccabb337a2dc3bdb4a8.tar.bz2 puppet-9459f8fad296bea99dd9bccabb337a2dc3bdb4a8.tar.xz puppet-9459f8fad296bea99dd9bccabb337a2dc3bdb4a8.zip |
apache: add option to select default redirect URL
Add an option to change the URL to redirect to in case of unknown vhost.
If the option is not provided, a 404 error is returned.
Diffstat (limited to 'modules/apache/templates')
-rw-r--r-- | modules/apache/templates/00_default_vhosts.conf | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/apache/templates/00_default_vhosts.conf b/modules/apache/templates/00_default_vhosts.conf index a1afe9ca..9a5f586c 100644 --- a/modules/apache/templates/00_default_vhosts.conf +++ b/modules/apache/templates/00_default_vhosts.conf @@ -3,5 +3,13 @@ <Location /> Allow from all </Location> - Redirect / http://www.<%= @domain %>/ + <%- + default_redirect = scope.lookupvar('apache::var::default_vhost_redirect') + if default_redirect == '' + -%> + Redirect 404 / + ErrorDocument 404 "Page Not Found" + <%- else -%> + Redirect / <%= default_redirect %> + <%- end -%> </VirtualHost> |