WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Tonight I installed a clean copy of WordPress on my local machine, with the intent of trying to set up a subdomain multisite installation. (I've got lots of experience using subdirectories, but this is my first time using subdomains.)

I set up the following hostnames in my /etc/hosts file: multi snoopy.multi robots.multi

I installed WordPress and set up multisite as per the Codex's Create a Network page. I set up my Apache config so that snoopy.multi and robots.multi pointed to the same directory as multi. I signed in to http://multi/wp-admin/ and set up sites at snoopy.multi and robots.multi. Everything worked fine -- the new sites showed up in My Sites.

Only I couldn't log in to the subdomains' /wp-admin. If I entered the username and password that logged me in to the root site, I'd simply be redirected back to the login page. (Entering a bogus password did trigger the "can't log you in" message, though, which was weird.)

I did find a solution, and will post it as an answer here, in case anyone else runs into this issue. (That's kosher, right? I did a search to see if it had been answered before, but didn't find anything that sounded like exactly the same issue. If I'm wrong, please let me know.)


The solution below is apparently not a complete solution; I can log in to the subdomains' wp-admin pages, but now I'm unable to log in to the root site's wp-admin pages at http://multi/wp-admin . Any advice would be appreciated.

share|improve this question
up vote 1 down vote accepted

Google led me to this page: http://lauragentry.com/blog/2012/01/05/when-wordpress-network-subdomain-blogs-wont-let-you-log-in/

There's a chunk of code in there that I added to my wp-config.php file, to wit:

define('ADMIN_COOKIE_PATH', '/');
define('COOKIE_DOMAIN', '');
define('COOKIEPATH', '');
define('SITECOOKIEPATH', '');

What I don't quite understand is why this works. Anyone know?

Updated It doesn't completely work -- I can now log in to the subdomains, but not the root domain.

share|improve this answer
If you're still looking for an answer have you considered adding a bounty to your question? – Darth_Vader Jul 8 at 3:47
If I recall correctly (and there's no guarantee of that; this was 3+ years ago) the eventual solution was "wipe and reinstall", which wasn't that big a hardship because this was a local test installation. – Pat J Jul 8 at 12:51
Then can yoi accept your own question? – Darth_Vader Jul 8 at 13:09
I'd have sworn I did. Whoops. – Pat J Jul 8 at 18:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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