Some fixes and improvements related to the generation of Apache rewrite
rules (Feature: htdocsfallback).
This commit is contained in:
parent
8985614812
commit
4e0098e2c2
@ -325,21 +325,21 @@ public class DomainProcessorFactory implements EntityProcessorFactory {
|
||||
// TODO: This code should be cleaned up after switching to the velocity template engine.
|
||||
query.setParameter("option", "htdocsfallback");
|
||||
if (query.getResultList().isEmpty()) {
|
||||
templateVars.put("HTDOCSFALLBACKHTTP",
|
||||
templateVars.put("NOHTDOCSFALLBACKHTTP",
|
||||
" RewriteCond %{REQUEST_URI} !^/cgi-bin/\n" +
|
||||
" RewriteCond %{REQUEST_URI} !^/fastcgi-bin/\n" +
|
||||
" RewriteCond %{HTTP_HOST} ^(.+)\\.{DOM_HOSTNAME}\\.?(:80)?$ [novary]\n" +
|
||||
" RewriteCond /home/doms/{DOM_HOSTNAME}/subs/${tolower:%1} !-d\n" +
|
||||
" RewriteRule ^(.*) - [redirect=404,last]");
|
||||
templateVars.put("HTDOCSFALLBACKHTTPS",
|
||||
" RewriteRule ^(.*) - [redirect=404,last]\n");
|
||||
templateVars.put("NOHTDOCSFALLBACKHTTPS",
|
||||
" RewriteCond %{REQUEST_URI} !^/cgi-bin/\n" +
|
||||
" RewriteCond %{REQUEST_URI} !^/fastcgi-bin/\n" +
|
||||
" RewriteCond %{HTTP_HOST} ^(.+)\\.{DOM_HOSTNAME}\\.?(:443)?$ [novary]\n" +
|
||||
" RewriteCond /home/doms/{DOM_HOSTNAME}/subs-ssl/${tolower:%1} !-d\n" +
|
||||
" RewriteRule ^(.*) - [redirect=404,last]");
|
||||
" RewriteRule ^(.*) - [redirect=404,last]\n");
|
||||
} else {
|
||||
templateVars.put("HTDOCSFALLBACKHTTP", "\n");
|
||||
templateVars.put("HTDOCSFALLBACKHTTPS", "\n");
|
||||
templateVars.put("NOHTDOCSFALLBACKHTTP", "\n");
|
||||
templateVars.put("NOHTDOCSFALLBACKHTTPS", "\n");
|
||||
}
|
||||
|
||||
Processor domSetupProcessor = new CompoundProcessor(
|
||||
|
@ -37,7 +37,13 @@
|
||||
RewriteEngine On
|
||||
RewriteOptions Inherit
|
||||
|
||||
{HTDOCSFALLBACKHTTP}
|
||||
RewriteCond %{REQUEST_URI} !^/cgi-bin/
|
||||
RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
|
||||
RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:[0-9]+)?$ [novary]
|
||||
RewriteCond /home/doms/{DOM_HOSTNAME}/subs/${tolower:%1} -d
|
||||
RewriteRule ^(.*) /home/doms/{DOM_HOSTNAME}/subs/${tolower:%1}$1 [last]
|
||||
|
||||
{NOHTDOCSFALLBACKHTTP}
|
||||
|
||||
AddType application/x-httpd-php .php .php5 .php4 .php3
|
||||
Action application/x-httpd-php /fastcgi-bin/phpstub
|
||||
@ -85,7 +91,13 @@
|
||||
RewriteEngine On
|
||||
RewriteOptions Inherit
|
||||
|
||||
{HTDOCSFALLBACKHTTPS}
|
||||
RewriteCond %{REQUEST_URI} !^/cgi-bin/
|
||||
RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
|
||||
RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:[0-9]+)?$ [novary]
|
||||
RewriteCond /home/doms/{DOM_HOSTNAME}/subs-ssl/${tolower:%1} -d
|
||||
RewriteRule ^(.*) /home/doms/{DOM_HOSTNAME}/subs-ssl/${tolower:%1}$1 [last]
|
||||
|
||||
{NOHTDOCSFALLBACKHTTPS}
|
||||
|
||||
AddType application/x-httpd-php .php .php5 .php4 .php3
|
||||
Action application/x-httpd-php /fastcgi-bin/phpstub
|
||||
|
@ -32,7 +32,13 @@
|
||||
RewriteEngine On
|
||||
RewriteOptions Inherit
|
||||
|
||||
{HTDOCSFALLBACKHTTP}
|
||||
RewriteCond %{REQUEST_URI} !^/cgi-bin/
|
||||
RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
|
||||
RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:[0-9]+)?$ [novary]
|
||||
RewriteCond /home/doms/{DOM_HOSTNAME}/subs/${tolower:%1} -d
|
||||
RewriteRule ^(.*) /home/doms/{DOM_HOSTNAME}/subs/${tolower:%1}$1 [last]
|
||||
|
||||
{NOHTDOCSFALLBACKHTTP}
|
||||
|
||||
</VirtualHost>
|
||||
|
||||
@ -72,7 +78,13 @@
|
||||
RewriteEngine On
|
||||
RewriteOptions Inherit
|
||||
|
||||
{HTDOCSFALLBACKHTTPS}
|
||||
RewriteCond %{REQUEST_URI} !^/cgi-bin/
|
||||
RewriteCond %{REQUEST_URI} !^/fastcgi-bin/
|
||||
RewriteCond %{HTTP_HOST} ^(.+)\.{DOM_HOSTNAME}\.?(:[0-9]+)?$ [novary]
|
||||
RewriteCond /home/doms/{DOM_HOSTNAME}/subs-ssl/${tolower:%1} -d
|
||||
RewriteRule ^(.*) /home/doms/{DOM_HOSTNAME}/subs-ssl/${tolower:%1}$1 [last]
|
||||
|
||||
{NOHTDOCSFALLBACKHTTPS}
|
||||
|
||||
</VirtualHost>
|
||||
<!-- END: main -->
|
Loading…
Reference in New Issue
Block a user