From fedfa6f6c096e432983aa12560b012dd7ba72376 Mon Sep 17 00:00:00 2001
From: Michael Hierweck <michael.hierweck@hostsharing.net>
Date: Wed, 15 Aug 2012 12:50:19 +0200
Subject: [PATCH] Das Template unterst├╝tzt die Deaktivierung des Fallbacks auf htdocs(-ssl) nicht nicht als Verzeichnis angelegte Subdomains unter subs(-ssl).

---
 hsarback/src/de/hsadmin/mods/dom/httpd-vhost-dynamic.jtpl |   32 +++++++++++++++++---------------
 1 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/hsarback/src/de/hsadmin/mods/dom/httpd-vhost-dynamic.jtpl b/hsarback/src/de/hsadmin/mods/dom/httpd-vhost-dynamic.jtpl
index 45ec4a0..ea86656 100644
--- a/hsarback/src/de/hsadmin/mods/dom/httpd-vhost-dynamic.jtpl
+++ b/hsarback/src/de/hsadmin/mods/dom/httpd-vhost-dynamic.jtpl
@@ -1,7 +1,4 @@
-<!-- BEGIN: main -->NameVirtualHost {DOM_IPNUMBER}:80
-NameVirtualHost {DOM_IPNUMBEREX}:80
-
-<VirtualHost {DOM_IPNUMBER}:80 {DOM_IPNUMBEREX}:80>
+<!-- BEGIN: main --><VirtualHost {DOM_IPNUMBER}:80 {DOM_IPNUMBEREX}:80>
 
     ServerName {DOM_HOSTNAME}
     ServerAlias *.{DOM_HOSTNAME}
@@ -34,22 +31,23 @@
 
     RewriteEngine On
     RewriteOptions Inherit
-    #RewriteLog /home/doms/{DOM_HOSTNAME}/var/rewrite.log
-    #RewriteLogLevel 9
-
+    
     RewriteCond %{REQUEST_URI} !^/cgi-bin/
     RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
     RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:80)?$ [novary]
     RewriteCond /home/doms/{DOM_HOSTNAME}/subs/${tolower:%1} -d
     RewriteRule ^(.*) /home/doms/{DOM_HOSTNAME}/subs/${tolower:%1}$1 [last]
 
-    AddType application/x-httpd-php .php .php5 .php4 .php3
+<!-- BEGIN: nosubdomainfallbackforhttp -->    RewriteCond %{REQUEST_URI} !^/cgi-bin/
+    RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
+    RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:80)?$ [novary]
+    RewriteCond /home/doms/{DOM_HOSTNAME}/subs/${tolower:%1} !-d
+    RewriteRule ^(.*) - [redirect=404,last]
+
+<!-- END: nosubdomainfallbackforhttp -->    AddType application/x-httpd-php .php .php5 .php4 .php3
     Action application/x-httpd-php /fastcgi-bin/phpstub
 
 </VirtualHost>
-
-NameVirtualHost {DOM_IPNUMBER}:443
-NameVirtualHost {DOM_IPNUMBEREX}:443
 
 <VirtualHost {DOM_IPNUMBER}:443 {DOM_IPNUMBEREX}:443>
 
@@ -91,16 +89,20 @@
     
     RewriteEngine On
     RewriteOptions Inherit
-    #RewriteLog /home/doms/{DOM_HOSTNAME}/var/rewrite.log
-    #RewriteLogLevel 9
 
     RewriteCond %{REQUEST_URI} !^/cgi-bin/
     RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
     RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:443)?$ [novary]
     RewriteCond /home/doms/{DOM_HOSTNAME}/subs-ssl/${tolower:%1} -d
     RewriteRule ^(.*) /home/doms/{DOM_HOSTNAME}/subs-ssl/${tolower:%1}$1 [last]
-
-    AddType application/x-httpd-php .php .php5 .php4 .php3
+    
+<!-- BEGIN: nosubdomainfallbackforhttps -->    RewriteCond %{REQUEST_URI} !^/cgi-bin/
+    RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
+    RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:443)?$ [novary]
+    RewriteCond /home/doms/{DOM_HOSTNAME}/subs-ssl/${tolower:%1} !-d
+    RewriteRule ^(.*) - [redirect=404,last]
+    
+<!-- END: nosubdomainfallbackforhttps -->    AddType application/x-httpd-php .php .php5 .php4 .php3
     Action application/x-httpd-php /fastcgi-bin/phpstub
 
 </VirtualHost>

--
Gitblit v1.9.1