multisite - Subdomain login problems

Tonight I installed a clean copy of WordPress on my local machine, with the intent of trying to set up a subdomain multi

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:

127.0.0.1 multi
127.0.0.1 snoopy.multi
127.0.0.1 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.)

Edit

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.

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:

127.0.0.1 multi
127.0.0.1 snoopy.multi
127.0.0.1 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.)

Edit

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 edited May 6, 2013 at 3:06 Pat J asked May 6, 2013 at 2:51 Pat JPat J 12.5k2 gold badges28 silver badges36 bronze badges 1
  • Does this answer your question? Are nested subdomains possible with a subdomain multisite? – php-b-grader Commented Apr 29, 2023 at 23:00
Add a comment  | 

1 Answer 1

Reset to default 1

Google led me to this page: http://lauragentry/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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744967743a4603785.html

相关推荐

  • multisite - Subdomain login problems

    Tonight I installed a clean copy of WordPress on my local machine, with the intent of trying to set up a subdomain multi

    1天前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信