diff --git a/scripts/jobs/cron_tasks.inc.http.10.apache.php b/scripts/jobs/cron_tasks.inc.http.10.apache.php index ffcfab92..ed63fbaa 100644 --- a/scripts/jobs/cron_tasks.inc.http.10.apache.php +++ b/scripts/jobs/cron_tasks.inc.http.10.apache.php @@ -767,12 +767,15 @@ 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); + } // redirect everything, not only root-directory, #541 - $vhost_content.= ' '."\n"; $vhost_content.= ' RewriteEngine On' . "\n"; $vhost_content.= ' RewriteCond %{HTTPS} off' . "\n"; - $vhost_content.= ' RewriteRule (.*) '. $this->idnaConvert->encode($domain['documentroot']).'%{REQUEST_URI}'. "\n"; + $vhost_content.= ' RewriteRule (.*) '. $corrected_docroot.'%{REQUEST_URI}'. "\n"; $vhost_content.= ' ' . "\n"; $code = getDomainRedirectCode($domain['id']);