I have three domains that are pointing to the same website like this:

example.com example.org example.net All of those work from the same db. But If I login to the example.com website and then go to example.org I have to login again.

The second question: If I'm logged in example.com and then go to www.example.com I have to login again! Is it a server that misconfigured or what should I do?


If you want a simple solution I can suggest what I did before is to redirect both domain.org and domain.net to domain.com using .htaccess redirect rule then all users will be reffered to domain.com first and then log in once there.

You need something like that in .htaccess (or simillar in your httpd configuration file):

RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com [NC]
RewriteRule ^(.*)\.html$ http://domain.com/$1.html [R=301,L]

Or do you need more complex set up and have separate 3 domains with single sign on ? Then try to use Domain Access module (http://drupal.org/project/domain).


Pretty sure you are running into problem with the cookie domain.

There are a few ways to deal with it. This article provides a start, as will googling for "drupal cookie domain".

Personally, I would always run a site a canonical domain, and redirect the multiple domains to a single one, and pick whether you want the leading www or not. This will solve most of your problems (unless you really do want the multiple domains).

You can put something like this in your .htaccess or Apache config.

# canonical URL redirection to www.domain.com
RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]

Just remember to save your .htaccess when you update Drupal if you stick this rule here.

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.