[development] Accommodating a second base_url

Jeff Greenberg jeff at ayendesigns.com
Fri Oct 30 02:03:18 UTC 2009


Khalid Baheyeldin wrote:

> Leave the $base_url alone. Drupal will figure it out automatically.
>
> You can have one install (single code base), and one database, and 
> don't set $base_url.
>
> Then do something like this in template.php:
>
I think everyone who responded subsequently is missing the point that 
the change of $base_url was to address all the places in the content, 
blocks, views, etc. that use $base_url to build the url for something, 
not only for the banner. The links, if the site is requested as 
mydomain2.com/drupalsubdirectory have to all say that, and it doesn't 
(in my experience) build the $base_url with a subdirectory 
automatically. I didn't know it would change based on the domain 
changing, which is good to find out, but that doesn't solve the problem 
that it had to be set manually in the first place because of the 
subdirectory, and that all the links that use a full url have to use the 
requested domain.


More information about the development mailing list