Fix bug: with a SSL-enabled domain and redirect Apache won't start
This commit is contained in:
@@ -766,32 +766,6 @@ class apache
|
|||||||
$domain['documentroot'] = 'https://' . $domain['domain'] . '/';
|
$domain['documentroot'] = 'https://' . $domain['domain'] . '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(preg_match('/^https?\:\/\//', $domain['documentroot']))
|
|
||||||
{
|
|
||||||
$corrected_docroot = $this->idnaConvert->encode($domain['documentroot']);
|
|
||||||
if(substr($corrected_docroot, -1) == '/') {
|
|
||||||
$corrected_docroot = substr($corrected_docroot, 0, -1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Get domain's redirect code */
|
|
||||||
$code = getDomainRedirectCode($domain['id']);
|
|
||||||
$modrew_red = '';
|
|
||||||
if ($code != '') {
|
|
||||||
$modrew_red = '[R='. $code . ';L]';
|
|
||||||
}
|
|
||||||
|
|
||||||
// redirect everything, not only root-directory, #541
|
|
||||||
$vhost_content.= ' <IfModule mod_rewrite.c>'."\n";
|
|
||||||
$vhost_content.= ' RewriteEngine On' . "\n";
|
|
||||||
$vhost_content.= ' RewriteCond %{HTTPS} off' . "\n";
|
|
||||||
$vhost_content.= ' RewriteRule (.*) '. $corrected_docroot.'%{REQUEST_URI} ' . $modrew_red . "\n";
|
|
||||||
$vhost_content.= ' </IfModule>' . "\n";
|
|
||||||
|
|
||||||
$code = getDomainRedirectCode($domain['id']);
|
|
||||||
$vhost_content.= ' Redirect '.$code.' / ' . $this->idnaConvert->encode($domain['documentroot']) . "\n";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if($ssl_vhost === true
|
if($ssl_vhost === true
|
||||||
&& $domain['ssl'] == '1'
|
&& $domain['ssl'] == '1'
|
||||||
&& $this->settings['system']['use_ssl'] == '1')
|
&& $this->settings['system']['use_ssl'] == '1')
|
||||||
@@ -840,6 +814,32 @@ class apache
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(preg_match('/^https?\:\/\//', $domain['documentroot']))
|
||||||
|
{
|
||||||
|
$corrected_docroot = $this->idnaConvert->encode($domain['documentroot']);
|
||||||
|
if(substr($corrected_docroot, -1) == '/') {
|
||||||
|
$corrected_docroot = substr($corrected_docroot, 0, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Get domain's redirect code */
|
||||||
|
$code = getDomainRedirectCode($domain['id']);
|
||||||
|
$modrew_red = '';
|
||||||
|
if ($code != '') {
|
||||||
|
$modrew_red = '[R='. $code . ';L]';
|
||||||
|
}
|
||||||
|
|
||||||
|
// redirect everything, not only root-directory, #541
|
||||||
|
$vhost_content.= ' <IfModule mod_rewrite.c>'."\n";
|
||||||
|
$vhost_content.= ' RewriteEngine On' . "\n";
|
||||||
|
$vhost_content.= ' RewriteCond %{HTTPS} off' . "\n";
|
||||||
|
$vhost_content.= ' RewriteRule (.*) '. $corrected_docroot.'%{REQUEST_URI} ' . $modrew_red . "\n";
|
||||||
|
$vhost_content.= ' </IfModule>' . "\n";
|
||||||
|
|
||||||
|
$code = getDomainRedirectCode($domain['id']);
|
||||||
|
$vhost_content.= ' Redirect '.$code.' / ' . $this->idnaConvert->encode($domain['documentroot']) . "\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
mkDirWithCorrectOwnership($domain['customerroot'], $domain['documentroot'], $domain['guid'], $domain['guid'], true, true);
|
mkDirWithCorrectOwnership($domain['customerroot'], $domain['documentroot'], $domain['guid'], $domain['guid'], true, true);
|
||||||
$vhost_content.= $this->getWebroot($domain);
|
$vhost_content.= $this->getWebroot($domain);
|
||||||
if ($this->_deactivated == false) {
|
if ($this->_deactivated == false) {
|
||||||
|
|||||||
Reference in New Issue
Block a user