WordPress.org

Support

Support » Multisite » nginx – Network admin pointing to root as opposed to subdirectory

nginx – Network admin pointing to root as opposed to subdirectory

  • hgrianevans

    @hgrianevans

    Using nginx, I’ve installed WordPress to /blogs and enabled network sites.

    All my main site links point to example.com/blogs, but when I go to network admin the links point to http://www.example.com/wp-admin/network/ instead of http://www.example.com/blogs/wp-admin/network/

    Here’s the multisite section in my config:

    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    $base = '/blogs';
    define('DOMAIN_CURRENT_SITE', 'www.example.com');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);

    If I tried changing PATH_CURRENT_SITE to /blogs, I’d get a db connection error.

    Thanks.

Viewing 15 replies - 1 through 15 (of 84 total)
  • Moderator Ipstenu (Mika Epstein)

    @ipstenu

    You cannot (yet) run WP out of a subdirectory and have Multisite 🙁

    hgrianevans

    @hgrianevans

    But didn’t you and I discuss this over here? http://wordpress.org/support/topic/multisite-and-non-root-install?replies=6#post-3099122

    I asked “Can I install WP in, say, /blogs and have my various blogs as /blogs/blog1, /blogs/blog2, etc?”

    to which you replied “Sure, just install WP in the folder /blogs” along with other notes.

    Please don’t say I’ve wasted a few hours…

    Moderator Ipstenu (Mika Epstein)

    @ipstenu

    That’s true.

    But you can’t have http://www.example.com/wp-admin/network/ if WP is in http://www.example.com/blogs/

    Where are your files located on your server? In /blogs/ right?

    And you had WP as a single install running from /blogs with the URL of example.com/blogs?

    hgrianevans

    @hgrianevans

    I just installed it today. Clean install.

    So the WP install is in /blogs. Admin is at /blogs/wp-admin/

    But Network Admin menu is pointing to /wp-admin/network/ instead of
    /blogs/wp-admin/network/

    Also, Network Admin->Visit Sites is pointing to our site’s root, instead of /blogs

    Moderator Ipstenu (Mika Epstein)

    @ipstenu

    That’s very odd. It sounds like you accidently set it up to run out of root.

    When you install WP, you had both the home URL and site URL pointing to example.com/blogs, right?

    hgrianevans

    @hgrianevans

    Right now I’m blanking. Would I have set that when I was editing wp-config? Or was that in a form in the install.

    Brand spanking new install so I can start again from scratch…what would I need to do…just drop the tables?

    Moderator Ipstenu (Mika Epstein)

    @ipstenu

    Drop the tables and you may as well nuke the files as well.

    Copy a fresh version of WP to domain.com.blogs/

    Start from there (and do make the site domain.com, without the www, to avoid otehr issues)

    hgrianevans

    @hgrianevans

    Is the without ‘www’ a huge issue? Our server config automatically redirects all example.com views to http://www.example.com to avoid issues with Google and duplication.

    Moderator Ipstenu (Mika Epstein)

    @ipstenu

    It can be.

    I’ll put it this way – I’ve never seen upgrade problems with non-www sites, but I have seen them with www ones :/

    hgrianevans

    @hgrianevans

    Sorry for the break…was covering the Toronto Film Festival.

    Did a reinstall and both the WordPress address and Site address are pointing to example.com/blogs

    When I did the Network install the options for wp-config were:

    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    $base = '/';
    define('DOMAIN_CURRENT_SITE', 'example.com');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);

    While Network->Visit Site is pointing to example.com/blogs, Network->Edit Site is pointing to:

    example.com/wp-admin/network/site-info.php?id=1

    What’s the next step to make it point to example.com/blogs/wp-admin/network/site-info.php?id=1 instead?

    Also the My Sites->Network Admin links are all pointing to the domain’s root and not /blogs

    Thanks.

    Moderator Ipstenu (Mika Epstein)

    @ipstenu

    What’s the next step to make it point to example.com/blogs/wp-admin/network/site-info.php?id=1 instead?

    If you want your URLs to be domain.com/blogs, you install in domain.com/blogs

    We went over the part where you cannot (yet) run WP out of a subdirectory and have Multisite, right?

    hgrianevans

    @hgrianevans

    Okay, I think we’re beginning to talk at cross purposes here.

    We went over the part where you cannot (yet) run WP out of a subdirectory and have Multisite, right?

    Yes, you mentioned that, but in that case I don’t get your previous answers in http://wordpress.org/support/topic/multisite-and-non-root-install?replies=6#post-3099122

    To retiretate, as I did above, I asked “Can I install WP in, say, /blogs and have my various blogs as /blogs/blog1, /blogs/blog2, etc?”

    You said, “Sure, just install WP in the folder /blogs” and followed that up with “So if you install WordPress in domain.com/blogs/, then the main site is domain.com/blogs/ and the subsites are domain.com/blogs/site2 and so on.”

    So I installed WP in domain.com/blogs

    It works. I follow the instructions to set up a network. That works. But there’s an error in the admin links. They point to wp-admin in domain.com, a subdir that does not exist, and not wp-admin in the domain.com/blogs directory, a subdir that does exists.

    So I guess the crossed wires in the understanding occurs here. If you say “you cannot (yet) run WP out of a subdirectory and have Multisite” then how can you suggest that I can run multiple blogs in http://wordpress.org/support/topic/multisite-and-non-root-install?replies=6#post-3095243 by saying “So if you install WordPress in domain.com/blogs/, then the main site is domain.com/blogs/ and the subsites are domain.com/blogs/site2 and so on.”

    So I guess the ultimate question here is why tell me “the main site is domain.com/blogs/ and the subsites are domain.com/blogs/site2 and so on” if that’s not the case and the admin urls in the dashboard don’t allow it.

    I’m not meaning to be difficult. I’m just trying to understand how there are two contradictory answers to the question.

    Thanks.

    Moderator Ipstenu (Mika Epstein)

    @ipstenu

    If you install domain.com/blogs then your main URL will forever be domain.com/blogs

    You cannot use domain.com in that setup. There will not be a domain.com/WP-admin folder, ever.

    So when you keep saying you’re poking at that, I have to come back and say no. You need to go to domain.com/blogs/WP-admin, because you cannot have WP in domain.com/blogs and use that to control domain.com – that is what I mean when I say you can’t have it in a subdirectory like you do single site install.

    Now, if something is sending you to the domain.com/wp-admin URL then what is that something? You just say there’s a link 🙂 there are lots of links.

    hgrianevans

    @hgrianevans

    If you install domain.com/blogs then your main URL will forever be domain.com/blogs

    I know that. We discussed that. I don’t want anything to be in domain.com and there isn’t anything in domain.com. What I said was that there are links that are pointing to /wp-admin in the dashboard instead of /blogs/wp-admin

    Now, if something is sending you to the domain.com/wp-admin URL then what is that something? You just say there’s a link 🙂 there are lots of links.

    Mika, I specifically did mention the links that are pointing incorrectly to domain.com. Look 4 messages up, the one that mentions the festival. I say:

    While Network->Visit Site is pointing to example.com/blogs, Network->Edit Site is pointing to:

    example.com/wp-admin/network/site-info.php?id=1

    Other incorrect URLS on the dashboard strip at the top:

    My Sites->Network Admin is pointing to domain.com/wp-admin/network/

    Next to that series of links, under the name of my Blog Network, Visit Site points to domain.com/blogs but Edit Site points to domain.com/wp-admin/network/site-info.php?id=1 where it should be pointing to domain.com/blogs/wp-admin/network/site-info.php?id=1

    Another issue: If I manually enter the URL domain.com/blogs/wp-admin/network/site-info.php?id=1 it incorrectly says the main site is at:

    Domain https://domain.com
    Path /

    I hope this clears things up. WordPress is installed in /blogs. I do not want/expect/think anything should be in /, but somewhere/somehow WP is creating links and configurations that point to /.

    I don’t know where our misunderstanding is coming from. You keeping saying things like “You cannot use domain.com in that setup. There will not be a domain.com/WP-admin folder, ever.” I don’t expect there to be. It’s WP that is pointing to URLs in the server root, and I cannot stress enough that based on the installation, I know/expect that everything should be under /blogs. But it’s WP that’s creating the wrong links.

    Moderator Ipstenu (Mika Epstein)

    @ipstenu

    While Network->Visit Site is pointing to example.com/blogs, Network->Edit Site is pointing to:

    example.com/wp-admin/network/site-info.php?id=1

    What’s the next step to make it point to example.com/blogs/wp-admin/network/site-info.php?id=1 instead?

    Also the My Sites->Network Admin links are all pointing to the domain’s root and not /blogs

    Okay, please be patient with me 🙂 You have a LOT of text going on and some of the earlier stuff (spread across two posts) was unclear. (Also my apologies, last night I was fresh off a plane.)

    To clarify, are you saying that ALL of your Network Admin links point to domain root? Because that indicates you did exactly what I said not to, which is part of why I keep reiterating it. Basically, WP is stupid 🙂 It can’t know a place exists unless you tell it 😉

    Go into your database and look for the wp_site table. Yours should have domain.com as the domain, and ‘/blogs/’ as the path – does it?

    Also this:

    $base = '/';

    In your wp-config.php is wrong. That too should be $base = '/blogs/';

    Again, that’s a direct symptom of ‘installing in a subfolder, running in root.’

Viewing 15 replies - 1 through 15 (of 84 total)
  • The topic ‘nginx – Network admin pointing to root as opposed to subdirectory’ is closed to new replies.