Seeking good practice advice: multisite in Drupal

Posted by deanloh on Stack Overflow See other posts from Stack Overflow or by deanloh
Published on 2010-01-17T01:19:24Z Indexed on 2010/05/07 23:08 UTC
Read the original article Hit count: 181

Filed under:

I'm using multisite to host my client sites.

During development stage, I use subdomain to host the staging site, e.g. client1.mydomain.com.
And here's how it look under the SITES folder:

/sites/client1.mydomain.com

When the site is completed and ready to go live, I created another folder for the actual domain, e.g. client1.com. Hence:

/sites/client1.com

Next, I created symlinks under client1.com for FILES and SETTINGS.PHP that points to the subdomain
i.e.

/sites/client1.com/settings.php --> /sites/client1.mydomain.com/settings.php

/sites/client1.com/files --> /sites/client1.mydomain.com/files

Finally, to prevent Google from indexing both the subdomain and actual domain, I created the rule in .htaccess to rewrite client1.mydomain.com to client1.com, therefore, should anyone try to access the subdomain, he will be redirected to the actual domain.

This above arrangement works perfectly fine. But I somehow feel there is a better way to achieve the above in much simplified manner. Please feel free to share your views and all advice is much appreciated.

© Stack Overflow or respective owner

Related posts about drupal