We have a Drupal 7 setup where the same URL was used for both viewing content and logging in, in the usual way. Now, the original URL is used for viewing content, but you can't log in if you're accessing the site from that URL. You can now only log in if you're accessing a site from a new URL.

To clarify, the different URLs are used for:

  • Public hostname: content viewing by the public, and you can't login from this URL
  • Private hostname: logging in by our staff, for adding content

Appropriate mappings were added to the sites.php file.

After making this change, when new content is created the host component of the URL that it generates when viewed via either hostname changed to the one it's logged in from. When I say host component, I mean 'www.example.com' of 'www.example.com/path/to/page' - the URL component displayed before the text field at /admin/config/system/site-information when it asks you to specify your front page.

$base_url in settings.php has not and never has been set.

Why has this changed, and how can I change it back/to an arbitrary value of my choosing?

Excerpt of sites.php file as requested:

$sites['stage-drupal.example.com'] = 'default';
$sites['drupal-cms-en'] = 'default';
$sites['drupal-cms-en.example.com'] = 'default';
$sites['stage-drupal-cms-en.example.com'] = 'default';
$sites['aws-drupal-en'] = 'default';

$sites['stage-drupal.example.de'] =  'drupal.example.de';
$sites['drupal-de.example.com'] =  'drupal.example.de';
$sites['drupal-cms-de'] = 'drupal.example.de';
$sites['drupal-cms-de.example.com'] = 'drupal.example.de';
$sites['stage-drupal-cms-de.example.com'] = 'drupal.example.de';
$sites['aws-drupal-de'] = 'drupal.example.de';
  • Posting contents of your sites.php file would help (change actual domain names to example.com, but try to point out different domains/sub domains). Also, I would double check the $cookie_domain variable in each settings.php file.
    – AKS
    Aug 11 '14 at 17:32
  • I've added a sanitised sites.php excerpt to the question, and $cookie_domain is not set in any settings.php file. Aug 12 '14 at 11:18

Your Answer

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

Browse other questions tagged or ask your own question.