Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.206.2.5
diff -u -9 -p -r1.206.2.5 bootstrap.inc
--- includes/bootstrap.inc	16 Oct 2008 12:51:56 -0000	1.206.2.5
+++ includes/bootstrap.inc	22 Oct 2008 16:25:03 -0000
@@ -212,18 +212,42 @@ function timer_stop($name) {
  *  8. $confdir/org.mysite
  *
  *  9. $confdir/8080.www.drupal.org
  * 10. $confdir/www.drupal.org
  * 11. $confdir/drupal.org
  * 12. $confdir/org
  *
  * 13. $confdir/default
  *
+ * If a file named sites.php is present in the $confdir, it will be loaded
+ * prior to scanning for directories.  It should define an associative array
+ * named $sites, which maps domains to directories.  It should be in the form
+ * of:
+ *
+ * $sites = array(
+ *   'The url to alias' => 'A directory within the sites directory'
+ * );
+ *
+ * For example:
+ *
+ * $sites = array(
+ *   'devexample.com' => 'example.com',
+ *   'localhost/example' => 'example.com',
+ * );
+ *
+ * The above array will cause Drupal to look for a directory named
+ * "example.com" in the sites directory whenever a request comes from
+ * "example.com", "devexample.com", or "localhost/example". That is useful
+ * on development servers, where the domain name may not be the same as the
+ * domain of the live server.  Since Drupal stores file paths into the database
+ * (files, system table, etc.) this will ensure the paths are correct while
+ * accessed on development servers.
+ *
  * @param $require_settings
  *   Only configuration directories with an existing settings.php file
  *   will be recognized. Defaults to TRUE. During initial installation,
  *   this is set to FALSE so that Drupal can detect a matching directory,
  *   then create a new settings.php file in it.
  * @param reset
  *   Force a full search for matching directories even if one had been
  *   found previously.
  * @return
@@ -231,24 +255,34 @@ function timer_stop($name) {
  */
 function conf_path($require_settings = TRUE, $reset = FALSE) {
   static $conf = '';
 
   if ($conf && !$reset) {
     return $conf;
   }
 
   $confdir = 'sites';
+
+  $sites = array();
+  if (file_exists($confdir . '/sites.php')) {
+    // This will overwrite $sites with the desired mappings.
+    include($confdir . '/sites.php');
+  }
+
   $uri = explode('/', $_SERVER['SCRIPT_NAME'] ? $_SERVER['SCRIPT_NAME'] : $_SERVER['SCRIPT_FILENAME']);
   $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));
-      if (file_exists("$confdir/$dir/settings.php") || (!$require_settings && file_exists("$confdir/$dir"))) {
+      if (isset($sites[$dir]) && file_exists($confdir . '/' . $sites[$dir])) {
+        $dir = $sites[$dir];
+      }
+      if (file_exists($confdir . '/' . $dir . '/settings.php') || (!$require_settings && file_exists($confdir . '/' . $dir))) {
         $conf = "$confdir/$dir";
         return $conf;
       }
     }
   }
   $conf = "$confdir/default";
   return $conf;
 }
 
Index: CHANGELOG.txt
===================================================================
RCS file: /cvs/drupal/drupal/CHANGELOG.txt,v
retrieving revision 1.253.2.14
diff -u -9 -p -r1.253.2.14 CHANGELOG.txt
--- CHANGELOG.txt	8 Oct 2008 20:47:04 -0000	1.253.2.14
+++ CHANGELOG.txt	22 Oct 2008 16:25:03 -0000
@@ -1,13 +1,15 @@
 // $Id: CHANGELOG.txt,v 1.253.2.14 2008/10/08 20:47:04 goba Exp $
 
 Drupal 6.6-dev, xxxx-xx-xx (development release)
 ----------------------
+- Added aliased multi-site support:
+    * Added support for mapping domain names to sites directories.
 
 Drupal 6.5, 2008-10-08
 ----------------------
 - Fixed security issues, (File upload access bypass, Access rules bypass,
   BlogAPI access bypass), see SA-2008-060.
 - Fixed a variety of small bugs.
 
 Drupal 6.4, 2008-08-13
 ----------------------
