0

I've got the following problem:

We've got a hosting with 2 domains applied (second domain (the drupal site) is pointing to a subfolder of the first domain):
/data/user/www/ < php-docroot & web-root of first domain
/data/user/www/domain2/ < web-root of second domain & drupal install

calling http: //domain2.tld/ succesfully showing the drupal site, but instead of:
http: //domain2.tld/content/contact, drupal generates url like:
http: //domain2.tld/domain2/content/contact

I think the problem may be the php-docroot, which is the same for domain1 and domain2.

How to tell Drupal to supress the /domain2/ part in urls?

  • It depends. What a contact is? A node? A page created by module? Are you using pathauto? – Mołot Nov 20 '13 at 15:31
  • contact was only an example, drupal adds the /domain2/-part to ALL urls on the site, and yes i'm using pathauto (& clean-urls) – Wolf Nov 20 '13 at 16:08
  • Weird. Is it added to all entries in the database? Or in the path entries in database it's OK but then on site it gets added? – Mołot Nov 21 '13 at 8:18
0

Like i noted above, drupal thinks it's installed in a sub-folder because of the php-docroot lies in the parent-folder of the drupal-install, so it added /domain2/ to the $base_url.

To fix it, just edit your current settings.php in sites/* folder:

$base_url = 'http://domain2.tld'; // NO trailing slash!

Make sure settings.php is writable, it's often read-only!
(this was the problem here, otherwise i would've saved a lot of time searching a alternative ways to fix the $base_url... looks like there's a overhaul needed in my svn:post_commit-ftp_upload-script ;)

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.