简体   繁体   中英

Wordpress Multi-Site in a SubDomain

I'm having trouble getting my Wordpress multi-site installation working the way I want it. I have 3 blogs that I want working in subdomains, and I want to use the main domain as the main website for other things.

So, I want:

  • Main Blog: stephen.digitaleagle.net
  • 2nd Blog: linuxsagas.digitaleagle.net
  • 3rd Blog: psst0101.digitaleagle.net

So, to log into the network, I would use this url: stephen.digitaleagle.net/wp-admin/network

I can't be the only one who wants it to work this way. Instead, it seems designed to work with the main blog on the main domain and the other blogs as subdomains.

When I create the 2nd blog, it was: linuxsagas.stephen.digitaleagle.net

I have gotten part way there...

Step 1: Created the site. (I actually used WP-Cli)

Step 2: I updated the wp2_option and wp3_option tables ... I changed the rows where the option_name field was siteurl or home.

Step 3: I edited the site on the sites page and changed the URL.

After those steps, the blogs show up on the correct URLs. My problem is that the admin logins don't work. I don't get an error message. it just doesn't log in for some reason.

If it makes a difference, I am using nginx instead of apache. I don't think that this the problem, because the URL takes me to wordpress.

Is there a correct way to do this? Is this not supported?

I finally figured it out by adding error_log() statements into the wordpress code and with this post: Can't log in: “ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.”

I cleared my cookies for the site, and that's when I started getting the error message about cookies not being enabled for the site.

I added this line to the wp-config.php file: define('COOKIE_DOMAIN', $_SERVER['HTTP_HOST'] );

I'm still not sure if this is the "right" way, but it is working, and I guess that is what counts.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM