0

Does it create any problems for me to use symlinks to display the same drupal site at more than one domain? It appears to work, but I'm not sure if bugs might appear in the future due to scripts being misinterpreted as XSS attacks or something.

Example

I own two domains, sweet-bro.com and hellajeff.net . They're hosted on the same account, such that people who go to sweet-bro.com see the files in ~/sweet-bro/html and people who go to hellajeff.net see the files in ~/hellajeff/html

There's a drupal 7 site at http://sweet-bro.com/drupal and I want visitors to see the same site if they go to http://hellajeff.net/ruse . So, first I make a symlink in the html directory:

ln -s ~/sweet-bro/html/drupal  ~/hellajeff/html/ruse

Then I make a symlink in the sites directory:

ln -s ~/sweet-bro/html/drupal/sites/default  ~/sweet-bro/html/drupal/sites/hellajeff.net.ruse

This is what I've done and it seems to be working. Is there any reason not to do it this way?

1

I don't think it's going to cause any problems, but it seems you just make things complicated for no reason. So, that would be a reason not do it that way :)

Just point both domaines to ~/sweet-bro/html and get rid of the symlink in /sites/.

Both domains will be showing the same site, as long as you don't use a .htaccess rule to redirect to one or the other.

  • It's true that this would work, but I'd prefer for hellajeff.net to be the main location for the site, and for that to be the domain the visitors see. In fact, I'm not interested in them visiting sweet-bro.com at all, it's just the main drupal install for a multisite setup. Sorry the question was misleading in that way -- I was trying to make it easier to explain. – octern Dec 31 '12 at 1:45

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.