First of all, this is kind of a feature request/bug report. That said, here is our problem:

We've run into a problem with the above-mentioned components. Our site (newamerica.net) is running on AEgir, with a combination of PURL for on-the-fly subdomain management with Spaces and Contexts. Here's what we've run across:

If you search from the main search page (newamerica.net/search) or even from a subdomained search page (say... asp.newamerica.net/search) and the result you are looking for is in another subdomain (say... earlyed.newamerica.net), the link in the search results redirects correctly.

However, we have an embedded search box (using drupal's built-in search box function) in the header of our site. If you search using *that* box in the main domain (www.newamerica.net or newamerica.net), the search results turn out fine. If you search using that box from a subdomain (asp.newamerica.net) and the search result points to another subdomain (earlyed.newamerica.net), the listed search result redirects to the searched-from subdomain (i.e. instead of going to earlyed.newamerica.net/yaddayaddayadda , the link goes to asp.newamerica.net/yaddayaddayadda).

This particularly causes problems for our site as we use the subdomain/space we are in to display theme elements. So, for us, when you go to the search result, it should show the header for earlyed with the earlyed content, but it shows earlyed content with the asp header.

Basically, we've tracked the problem down to the fact that AEgir does not set a base_url for the site in settings.php and doesn't even allow for base_url to be set in settings.php. This, in conjunction with the fact that the embedded search box (due to the way drupal parses the "action" of that form) uses a relative url instead of a set one, causes the problem.

Does anyone have any suggestions on how to handle this? I've looked for ways to force the search box to use a static base_url by either form_alter or preprocess functions in template.php, but I have had no luck finding anything and know just enough php to make myself dangerous. ;)

I would add the variable into newamerica.net's settings.php manually, but that has the possibility of sending AEgir into a tailspin and kill our whole site, especially when we upgrade the site. That's something I can *not* allow to happen.

Of course, the ultimate way to handle this is to get AEgir to specify a base_url in the settings.php of the site, but that option doesn't exist in the GUI.

Any help would be greatly appreciated.

Comments

adrian’s picture

Title: AEgir + PURL w/subdomains + Search = Major Search Problems » PURL w/subdomains + Search = Major Search Problems
Project: Hostmaster (Aegir) » Spaces
Version: 6.x-0.3 » 6.x-2.0-beta7
Component: User interface » Code
Priority: Critical » Normal

I've determined (and confirmed with jeff) that this is a spaces/purl issue.

All of the newamerica.net subsites are site aliases, which means that there is only one settings.php file, if you were to set the 'newamerica.net' domain explicitly in the settings.php, it would break the link generation of every single link on all of the subsites (really).

I'm moving this issue to the spaces queue, as this has nothing to do with Aegir.

jm.federico’s picture

Question

I see you are using google search now on your site. Did you give up on fixing the subdomain issue?

Something else. If you don't mind helping me here, how did you put in place the redirection system?

Say, if I you have a page:
http://assets.newamerica.net/blogposts/2010/gary_rivlin_author_of_broke_...
But I access it via
http://www.newamerica.net/blogposts/2010/gary_rivlin_author_of_broke_usa...
It takes me to the correct subdomain. How is that happening?

And one thing I found:

this redirection works:
http://www.newamerica.net/node/34533
but this one does not:
http://assets.newamerica.net/node/34533

You might want to look into that.

Thanks

jm.federico’s picture

Status: Active » Closed (won't fix)