From 954e5071609b6ec4ee2e1eea0e9314b73309f23b Mon Sep 17 00:00:00 2001 From: "Christoph Burchert (Chb)" Date: Fri, 18 Mar 2011 12:48:19 +0100 Subject: [PATCH] Pass redirect code to mod_rewrite directives, fixes #669 Signed-off-by: Christoph Burchert (Chb) --- scripts/jobs/cron_tasks.inc.http.10.apache.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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']);