when redirecting to an uri, don't use a trailing slash in order for the redirect to be correct, fixes #1411

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2014-05-02 08:49:27 +02:00
parent fceffc05e7
commit fb3d0269a1

View File

@@ -397,7 +397,11 @@ class nginx {
// if the documentroot is an URL we just redirect
if (preg_match('/^https?\:\/\//', $domain['documentroot'])) {
$vhost_content .= "\t".'rewrite ^(.*) '.$this->idnaConvert->encode($domain['documentroot']).'$1 permanent;'."\n";
$uri = $this->idnaConvert->encode($domain['documentroot']);
if (substr($uri, -1) == '/') {
$uri = substr($uri, 0, -1);
}
$vhost_content .= "\t".'rewrite ^(.*) '.$uri.'$1 permanent;'."\n";
} else {
mkDirWithCorrectOwnership($domain['customerroot'], $domain['documentroot'], $domain['guid'], $domain['guid'], true);