From 5742e4c99f53f9dbbcc962e9f967a4c377c209b9 Mon Sep 17 00:00:00 2001 From: Marius Cramer Date: Tue, 29 Jul 2014 08:46:41 +0200 Subject: [PATCH] Fixed: FS#3581 - Website unaccessible under some circumstances when using seo redirection *.domain to www.domain (only for apache2, nginx still to do) --- server/conf/vhost.conf.master | 2 ++ server/plugins-available/apache2_plugin.inc.php | 2 ++ server/plugins-available/nginx_plugin.inc.php | 2 ++ 3 files changed, 6 insertions(+) diff --git a/server/conf/vhost.conf.master b/server/conf/vhost.conf.master index 96b3443384..c2af3edeeb 100644 --- a/server/conf/vhost.conf.master +++ b/server/conf/vhost.conf.master @@ -339,10 +339,12 @@ RewriteEngine on + RewriteCond %{HTTP_HOST} $ [NC] RewriteCond %{HTTP_HOST} ^$ [NC] RewriteRule ^(.*)$ https://$1 [R=301,L] + RewriteCond %{HTTP_HOST} $ [NC] RewriteCond %{HTTP_HOST} ^$ [NC] RewriteRule ^(.*)$ https://$1 [R=301,L] diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php index addcd138b8..525592dacc 100644 --- a/server/plugins-available/apache2_plugin.inc.php +++ b/server/plugins-available/apache2_plugin.inc.php @@ -2951,6 +2951,8 @@ class apache2_plugin { $seo_redirects[$prefix.'seo_redirect_target_domain'] = $web['domain']; $seo_redirects[$prefix.'seo_redirect_operator'] = '!'; } + + $seo_redirects[$prefix.'seo_base_domain'] = str_replace('.', '\.', $web['domain']); return $seo_redirects; } diff --git a/server/plugins-available/nginx_plugin.inc.php b/server/plugins-available/nginx_plugin.inc.php index d83ecf442f..408a76bca2 100644 --- a/server/plugins-available/nginx_plugin.inc.php +++ b/server/plugins-available/nginx_plugin.inc.php @@ -2842,6 +2842,8 @@ class nginx_plugin { $seo_redirects[$prefix.'seo_redirect_operator'] = '!='; } } + + $seo_redirects[$prefix.'seo_base_domain'] = str_replace('.', '\.', $web['domain']); return $seo_redirects; } -- GitLab