summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Wittens <steven@10.no-reply.drupal.org>2005-11-21 16:24:41 +0000
committerSteven Wittens <steven@10.no-reply.drupal.org>2005-11-21 16:24:41 +0000
commitcbc92f59cffeabac208d607418c066ce47e99786 (patch)
tree8402b38ca7b6092e51b3c3a594bc96d00b83484c
parent463ffe24ece31fd094ca30ce8b8b485ee32161cf (diff)
downloadbrdo-cbc92f59cffeabac208d607418c066ce47e99786.tar.gz
brdo-cbc92f59cffeabac208d607418c066ce47e99786.tar.bz2
#35725: Make site.com:80 work like site.com
-rw-r--r--INSTALL.txt8
-rw-r--r--includes/bootstrap.inc2
2 files changed, 6 insertions, 4 deletions
diff --git a/INSTALL.txt b/INSTALL.txt
index 08fc248ca..d0662dfca 100644
--- a/INSTALL.txt
+++ b/INSTALL.txt
@@ -162,9 +162,11 @@ INSTALLATION
sites/example.com/settings.php
sites/default/settings.php
- If you are installing on a non-standard port number, the ':' is
- replaced by a '.'. For example, http://www.drupal.org:8080/mysite/test/
- could be loaded from sites/www.drupal.org.8080.mysite.test/.
+ If you are installing on a non-standard port, the port number is
+ treated as the deepest subdomain. For example: http://www.example.com:8080/
+ could be loaded from sites/8080.www.example.com/. The port number
+ will be removed according to the pattern above if no port-specific
+ configuration is found, just like a real subdomain.
Each site configuration can have its own site-specific modules and
themes that will be made available in addition to those installed
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 5f72665cd..6096ac6b2 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -115,7 +115,7 @@ function conf_init() {
$confdir = 'sites';
$uri = explode('/', $_SERVER['PHP_SELF']);
- $server = explode('.', str_replace(':', '.', rtrim($_SERVER['HTTP_HOST'], '.')));
+ $server = explode('.', implode('.', array_reverse(explode(':', rtrim($_SERVER['HTTP_HOST'], '.')))));
for ($i = count($uri) - 1; $i > 0; $i--) {
for ($j = count($server); $j > 0; $j--) {
$dir = implode('.', array_slice($server, -$j)) . implode('.', array_slice($uri, 0, $i));