0

With Drupal 7, it's fairly trivial to set up a local alias for a multi-site using the sites.php file. With Drupal 7, I can have a multi-site folder on my local dev be named:

subsite.com

... located in the /sites/ folder

so that it's: /sites/subsite.com/

Then in my sites.php file, I do something like this:

$sites['subsite.dev'] = 'subsite.com';

... but I can still view this local site in my browser as:

http://subsite.dev

This is good on many levels, it allows me to have a custom subsite (of a multi-site) as the actual name it will be on the remote server. Thus I can have custom modules and themes for the subsite in my Git repo. In addtion, if I clone the remote db back to local at any given point, any given site specific references do not need to be changed in the local DB.

The question then, is there any way to have similar local aliasing with Drupal 6. I know Drupal 6 does not have the sites.php file so I am not sure how else to do this. Becuase of this, right now I am stuck with rendering my local Drupal 6 multi-site folder as subsite.dev. I know I could chnage my "hosts" file in OS X but then I am stuck having to change it all the time to view the actual ".com" remote domain.

2

Seems like what you want could be accomplished by creating a symbolic link in the sites directory. Linking to subsite.com by the name subsite.dev would do it:

$ cd [sites-directory]
$ ln -s subsite.com subsite.dev

Mind you, you might need to change the $conf['cookie_domain'] and $conf['base_url'] values in the settings.php file if you want to be able to log in to your local dev site.

  • If you do need variations in the settings.php file, you can have a separate directory for subsite.dev, with it's own settings.php file, but then symlink some or all of the folders for modules, themes, files, and anything else you might have in there. – mc0e Dec 17 '14 at 7:02
0

Hi you can look at the "Aliased multi-site support" There are some patches.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.