From a3a3dec68c6891491021c0ed09ead06f02896d09 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Thu, 25 Mar 2010 06:51:02 +0000 Subject: [PATCH] - place redirect to vhost content if documentroot is a domain, fixes #89 --- .../jobs/cron_tasks.inc.http.20.lighttpd.php | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php b/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php index aaf037e2..9c08b02a 100644 --- a/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php +++ b/scripts/jobs/cron_tasks.inc.http.20.lighttpd.php @@ -313,19 +313,31 @@ class lighttpd $ipport = $domain['ip'] . ':' . $domain['port']; } - mkDirWithCorrectOwnership($domain['customerroot'], $domain['documentroot'], $domain['guid'], $domain['guid'], true); - $vhost_content.= $this->getServerNames($domain) . " {\n"; - $vhost_content.= $this->getWebroot($domain, $ssl_vhost); + + if(preg_match('/^https?\:\/\//', $domain['documentroot'])) + { + $vhost_content.= ' url.redirect = (' . "\n"; + $vhost_content.= ' "^/(.*)$" => "'. $this->idnaConvert->encode($domain['documentroot']) . '"/$1'. "\n"; + $vhost_content.= ' )' . "\n"; + } + else + { + mkDirWithCorrectOwnership($domain['customerroot'], $domain['documentroot'], $domain['guid'], $domain['guid'], true); + + $vhost_content.= $this->getWebroot($domain, $ssl_vhost); + $vhost_content.= $this->create_htaccess($domain); + $vhost_content.= $this->create_pathOptions($domain); + $vhost_content.= $this->composePhpOptions($domain); + $vhost_content.= $this->getStats($domain); + $vhost_content.= $this->getLogFiles($domain); + } + if ($domain['specialsettings'] != "") { $vhost_content.= $domain['specialsettings'] . "\n"; } - $vhost_content.= $this->create_htaccess($domain); - $vhost_content.= $this->create_pathOptions($domain); - $vhost_content.= $this->composePhpOptions($domain); - $vhost_content.= $this->getStats($domain); - $vhost_content.= $this->getLogFiles($domain); $vhost_content.= '}' . "\n"; + return $vhost_content; }