Commit f983fc4e authored by mig5's avatar mig5 Committed by mig5
Browse files

#605194 - only explode the aliases string if it exists, so a blank ServerAlias...

#605194 - only explode the aliases string if it exists, so a blank ServerAlias isn't generated in the vhost on Disabling of a site. Move the ServerAlias line if it's going to exist, above the RewriteRule, to be consistent with the standard vhost template
parent 7874f971
......@@ -137,7 +137,7 @@ function _provision_apache_create_vhost_config($url, $template = NULL) {
if (!empty($options['redirection'])) {
$template .= _provision_apache_redirect_template();
}
if (!is_array($options['aliases'])) {
if ($options['aliases'] && !is_array($options['aliases'])) {
$options['aliases'] = explode(",", $options['aliases']);
}
......
......@@ -6,10 +6,6 @@
ServerName <?php print $site_url; ?>
RewriteEngine on
# the ? at the end is to remove any query string in the original url
RewriteRule ^(.*)$ <?php print $redirect_url . '/' . $site_url ?>?
<?php if (is_array($aliases)) :
foreach ($aliases as $alias) : ?>
ServerAlias <?php print $alias; ?>
......@@ -17,4 +13,8 @@
endforeach;
endif; ?>
RewriteEngine on
# the ? at the end is to remove any query string in the original url
RewriteRule ^(.*)$ <?php print $redirect_url . '/' . $site_url ?>?
</VirtualHost>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment