• Hello world, I’m running into a difficult to diagnose problem as I’m trying to switch network type from subdomain to subdirectory for an existing and very active multisite install.

    When I set SUBDOMAIN_INSTALL to false and then try a blog URL as network.com/blog, WordPress takes /blog as an “incomplete slug” and returns a single post that belongs to the main blog at network.com.

    The server uses CentOS with the latest stable nginx and php-fpm. We use the standard domain mapping plugin and currently blog.network.com has blog.com set as primary domain. Everything works perfectly with subdomains and domain mapping.

    The relevant nginx location segment is:

    location / {
            try_files $uri $uri/ /index.php;
        }

    So nothing interferes with WP’s processing. Whatever resembling a pretty permalink get thrown to WP for deciding what to do and it’s doing the wrong thing. Caching plugins were disabled, without changes on the behavior.

    The only thing “strange” is that BLOG_ID_CURRENT_SITE set to an ID different to 1 because we changed the main domain to one of our blogs. The blog with ID=1 now resides at a subdomain “original.network.com”. I tried original.network.com/blog and it redirects me to the BLOG_ID_CURRENT_SITE (our new main blog) homepage.

    Now with SUBDOMAIN_INSTALL set to false, subdomains still work (and redirect to the correct primary mapped domain). I restarted EVERYTHING in the web stack, so this doesn’t seem to be a caching thing.

    Can somebody shed some light? I feel like I’m running in circles.

    Thanks in advance.

    Andres

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

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    I’m trying to switch network type from subdomain to subdirectory for an existing and very active multisite install.

    Why?

    You can manually edit the sites from foo.domain.com to domain.com/foo if needed.

    Thread Starter Andres

    (@andresb)

    Yes! Thanks for your answer. I figured this out this morning.
    I somehow thought the setting would impact WP’s internal blog resolution/redirection, now I know that either setting only affects the “new site” form for future additions.

    But my problem still stands:
    I set domain.com/blogname as URL and path on the site settings (update siteurl and home, etc.).
    Then I go to domain.com/blogname and WP redirects me to domain.com/check-out-blogname-our-new-blog, a post on the main blog.

    I refreshed (saved) the permalink structures at both blogs (/year/month/post-name), cleaned any rewrites/redirections in the nginx config, disabled caching plugins, etc. I’m positive I’m hitting /index.php every time and WP should do its magic, but it’s not happening.

    Does this mean that the blog at domain.com/ needs a /blog path in front of it to avoid conflicts between blogs vs posts URLs?

    I think I ran out of things to examine.

    Thanks in advance.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Does this mean that the blog at domain.com/ needs a /blog path in front of it to avoid conflicts between blogs vs posts URLs?

    If you’re using subfolders, yes.

    I tested this out with .htaccess/apache and it works fine to have a subdomain network but manually change foo.domain.com to domain.com/foo so I’m not sure if it’s your nginx conf or not…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘MS moving from subdomain to subdirectory doesn't work, shows posts’ is closed to new replies.