Commit 72f09e4b authored by mig5's avatar mig5 Committed by mig5

#940816 - we don't need to depend on Aliases for SSL redirection. Presence of...

#940816 - we don't need to depend on Aliases for SSL redirection. Presence of alias redirection already implies aliases so doesn't need to be in the wider alias conditional
parent 7afbd0ce
...@@ -23,23 +23,23 @@ ...@@ -23,23 +23,23 @@
<?php <?php
if (sizeof($this->aliases)) { if (sizeof($this->aliases)) {
print "\n ServerAlias " . implode("\n ServerAlias ", $this->aliases) . "\n"; print "\n ServerAlias " . implode("\n ServerAlias ", $this->aliases) . "\n";
}
if ($this->redirection || $ssl_redirection) {
print " RewriteEngine on\n";
if ($this->redirection || $ssl_redirection) { if ($ssl_redirection && !$this->redirection) {
print " RewriteEngine on\n"; // redirect aliases in non-ssl to the same alias on ssl.
print " RewriteRule ^/*(.*)$ https://%{HTTP_HOST}/$1 [L,R=301]\n";
if ($ssl_redirection && !$this->redirection) { }
// redirect aliases in non-ssl to the same alias on ssl. elseif ($ssl_redirection && $this->redirection) {
print " RewriteRule ^/*(.*)$ https://%{HTTP_HOST}/$1 [L,R=301]\n"; // redirect all aliases + main uri to the main https uri.
} print " RewriteRule ^/*(.*)$ https://{$this->uri}/$1 [L,R=301]\n";
elseif ($ssl_redirection && $this->redirection) { }
// redirect all aliases + main uri to the main https uri. elseif (!$ssl_redirection && $this->redirection) {
print " RewriteRule ^/*(.*)$ https://{$this->uri}/$1 [L,R=301]\n"; // Redirect all aliases to the main http url.
} print " RewriteCond %{HTTP_HOST} !^{$this->uri}$ [NC]\n";
elseif (!$ssl_redirection && $this->redirection) { print " RewriteRule ^/*(.*)$ http://{$this->uri}/$1 [L,R=301]\n";
// Redirect all aliases to the main http url.
print " RewriteCond %{HTTP_HOST} !^{$this->uri}$ [NC]\n";
print " RewriteRule ^/*(.*)$ http://{$this->uri}/$1 [L,R=301]\n";
}
} }
} }
?> ?>
......
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