[development] Loading configuration using 'SERVER_NAME' as opposed to 'HTTP_HOST'

Earnie Boyd earnie at users.sourceforge.net
Mon Mar 16 11:44:12 UTC 2009

Quoting Adam Cooper <adam.j.cooper at gmail.com>:

This is more a support question and should be on the support list but 
see below.

> The problem now is that I have come across one of my multisite  
> configurations. I figured I could just set the virtual host  
> configuration to have ServerName as my site name (sitename) and then  
> ServerAlias in the name I would be accessing it as (sitename.dev).  
> Setting UseCanonicalName to 'on' would let me access the site as I  
> would expect.
> Except, despite this setting SERVER_NAME to the value I expect  
> (sitename) my drupal configuration refuses to load. I took a look in  
> the bootstrap file and found that the configuration directory is  
> loaded from HTTP_HOST.

Usually I find the issue with this stems from the fact that the strings 
for the site directory in sites/ cannot be constructed from the 
HTTP_HOST string.  I usually resolve this issue with symlinks to match 
what is expected.  For instance www.sample.com vs sample.com and I 
created a www.sample.com directory under sites.

> TL;DR.
> So my question is this, why does drupal load it's configuration using 
>  HTTP_HOST as opposed to SERVER_NAME? Surely SERVER_NAME would allow  
> more flexibility and more direct control? Would a patch changing this 
>  have any chance of being looked at?

My question back to you is why isn't HTTP_HOST properly setup?

Earnie  http://r-feed.com
  Make a Drupal difference and review core patches.

-- http://for-my-kids.com/  -- http://www.4offer.biz/

More information about the development mailing list