Commit 85002c99 authored by omega8cc's avatar omega8cc

Apache: Print redirect comments in vhosts to support SAN compatibility...

Apache: Print redirect comments in vhosts to support SAN compatibility detection and autoconfiguration in hosting_le

Related commit in hosting_le: https://github.com/omega8cc/hosting_le/commit/3ea24cc101ad155bd345a1c1e6a55b3223e1dc8f
parent 90dfe7b9
......@@ -46,7 +46,7 @@ if (sizeof($this->aliases)) {
RewriteEngine on
<?php
if ($this->redirection) {
// Redirect to the selected alias.
print " # Redirect all aliases to the selected alias.\n";
print " RewriteCond %{HTTP_HOST} !^{$this->redirection}$ [NC]\n";
print " RewriteRule ^/*(.*)$ https://{$this->redirection}/$1 [NE,L,R=301]\n";
}
......
......@@ -34,15 +34,15 @@ if (sizeof($this->aliases)) {
if ($this->redirection || $ssl_redirection) {
if ($ssl_redirection && !$this->redirection) {
// redirect aliases in non-ssl to the same alias on ssl.
print " # Redirect aliases in non-ssl to the same alias on ssl.\n";
print " RewriteRule ^/*(.*)$ https://%{HTTP_HOST}/$1 [NE,L,R=301]\n";
}
elseif ($ssl_redirection && $this->redirection) {
// redirect all aliases + main uri to the main https uri.
print " # Redirect all aliases + main uri to the main https uri.\n";
print " RewriteRule ^/*(.*)$ https://{$this->uri}/$1 [NE,L,R=301]\n";
}
elseif (!$ssl_redirection && $this->redirection) {
// Redirect all aliases to the main http url.
print " # Redirect all aliases to the main http url.\n";
print " RewriteCond %{HTTP_HOST} !^{$this->redirection}$ [NC]\n";
print " RewriteRule ^/*(.*)$ http://{$this->redirection}/$1 [NE,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