Multisite - conf_path modification

SchnWalter's picture

Hello, I'm a newbie in the world of web-design, and 3 month ago I had an idea of a site which i now what to put it in practice. The great idea:

  1. 4 domains
    • domain1.tld
    • domain2.tld
    • domain3.tld
    • domain4.tld
  2. 6 subdomains, the same 6 for each of the domains
    • subdomain1.domainX.tld
    • subdomain2.domainX.tld
    • subdomain3.domainX.tld
    • subdomain4.domainX.tld
    • subdomain5.domainX.tld
    • subdomain6.domainX.tld

where domainX will be replaced by domain1, domain2 and so on, to be more precise:

  • subdomain3.domain1.tld
  • subdomain3.domain2.tld
  • subdomain3.domain3.tld
  • subdomain3.domain4.tld

will be the same site subdomain3 (except a part of a navbar - but i'm not concerned right now about making a different navbar based on the domain)

basically i have 6+4 sites which i want to manage from one drupal installation, and the ideea is to share only the users and their settings between the sites, so far so good... but i have a problem (actually I have more than one, but this one kills me) i need an advice

i saw the order in which "" returns the different sites from the sites folder... and I'm wondering if I should modify the "conf_path" in order to have what i need, or should i try and find another solution

here is the deal, if i create the folders

  • domain2.tld
  • subdomain3.domain2.tld

everything works ok, i have a subdomain3 site, but it cant use it as subdomain3.domain4.tld

if I create the folders

  • domain2.tld
  • subdomain3

every time i try to access subdomain3, from "subdomain3.domain2.tld" or "subdomain3.domain1.tld" it brings me to "domain2.tld" or "domain1.tld"

could someone clear things out for me...

thank you,



Garrett Albright's picture

Create subdomain1.domain1.tld, subdomain2.domain1.tld, etc. Then, create subdomain1.domain2.tld as a symbolic link of subdomain1.domain1.tld; create subdomain2.domain2.tld as a symbolic link of subdomain2.domain1.tld, etc.

never thought of it in this

SchnWalter's picture

never thought of it in this way.

I added an extra condition to the conf_path function and made it in such a way that it detects the subdomains first.
but now i'll have to modify the settings.php, or something else, so that the cookies work on all domains... but i'm still experimenting with my setup/different setups... i don't intend to make the sites public, at least not yet...

and after i'm satisfied with my setup i think that i'll post some kind of guide... so that others can benefit from what i've learned... i'm trying not to use any 3rd party module or something like that for a SSO (single sign-on) solution.

thanks for the tip.

i'm trying not to use any 3rd

Garrett Albright's picture

i'm trying not to use any 3rd party module or something like that for a SSO (single sign-on) solution.

Why not? Why reinvent the wheel?

D.o, G.d.o and A.d.o use the Bakery module to manage single sign-on between the sites. I'm not sure that's the highest commendation, but there you go.


SchnWalter's picture

it's not "reinventing the wheel", it's more like "understanding the wheel"...

as soon as i have a similar drupal setup, i'll give it a try, but i'm not sure if Bakery SSO-S module would work on "shared subdomains"... i'll have to test it/ i'll study it a bit... and then i'll come back whit my decision

thanks again...

thank you for your

SchnWalter's picture

thank you for your help...

the sites are up and running now... I settled for

  1. SSO module
  2. simbolic links (as you recommended)
  3. OG for each of the sites
  4. Global Avatar
  5. moved 'sites/*/files' folders to 'resources/*'

and everything seems to be working just fine