From 5b92a4d48d7faab163c089120047a4bd3332180f Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Tue, 05 Jun 2012 03:55:54 -0400
Subject: [PATCH] - Fixed: FS#2225 - webdav access not working when redirect is used to select website base directory - Improved https detection in  get_ispconfig_url() function.

---
 server/conf/vhost.conf.master           |    1 +
 interface/lib/classes/functions.inc.php |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/interface/lib/classes/functions.inc.php b/interface/lib/classes/functions.inc.php
index b744e35..7f4f31c 100644
--- a/interface/lib/classes/functions.inc.php
+++ b/interface/lib/classes/functions.inc.php
@@ -101,7 +101,7 @@
 	}
 	
 	public function get_ispconfig_url() {
-		$url = (stristr($_SERVER['SERVER_PROTOCOL'],'HTTPS'))?'https':'http';
+		$url = (stristr($_SERVER['SERVER_PROTOCOL'],'HTTPS') || stristr($_SERVER['HTTPS'],'on'))?'https':'http';
 		$url .= '://'.$_SERVER['SERVER_NAME'];
 		if($_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) {
 			$url .= ':'.$_SERVER['SERVER_PORT'];
diff --git a/server/conf/vhost.conf.master b/server/conf/vhost.conf.master
index 77bbb9d..ee31e5a 100644
--- a/server/conf/vhost.conf.master
+++ b/server/conf/vhost.conf.master
@@ -223,6 +223,7 @@
 </tmpl_if>
 <tmpl_loop name="redirects">
     RewriteCond %{HTTP_HOST}   <tmpl_var name='rewrite_domain'>$ [NC]
+	RewriteCond %{REQUEST_URI} !^/webdav/
     RewriteRule   ^/(.*)$ <tmpl_var name='rewrite_target'>$1  <tmpl_var name='rewrite_type'>
 </tmpl_loop>
 </tmpl_if>

--
Gitblit v1.9.1