diff --git a/scripts/jobs/cron_tasks.inc.http.10.apache.php b/scripts/jobs/cron_tasks.inc.http.10.apache.php index 9f565558..2be696d7 100644 --- a/scripts/jobs/cron_tasks.inc.http.10.apache.php +++ b/scripts/jobs/cron_tasks.inc.http.10.apache.php @@ -771,11 +771,19 @@ class apache 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.= ' '."\n"; $vhost_content.= ' RewriteEngine On' . "\n"; $vhost_content.= ' RewriteCond %{HTTPS} off' . "\n"; - $vhost_content.= ' RewriteRule (.*) '. $corrected_docroot.'%{REQUEST_URI}'. "\n"; + $vhost_content.= ' RewriteRule (.*) '. $corrected_docroot.'%{REQUEST_URI} ' . $modrew_red . "\n"; $vhost_content.= ' ' . "\n"; $code = getDomainRedirectCode($domain['id']);