• I have recently defined noblogredirect to my main domain, but after doing that all my 404 requests are being redirected to the main domain instead of serving the theme’s custom 404 page. Its a multisite install.

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

    (@ipstenu)

    ?????? Advisor and Activist

    Does it do that for all sites or just your main site?

    Thread Starter SoujanyaWp

    (@soujanyawp)

    Yes actually the situation remains same on my all ms subsites.! No matter what i type, a non existing site or a non existing page, it always redirects me to my main site, which i have defined in the noblogredirect.
    (all ms are wildcar subdomains)

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Okay, I can’t reproduce that on subsites (main site yes)

    What network activated plugins do you have?

    If you turn OFF no blog redirect, do the 404s work?

    I know this is a month+ out, but I’m curious about the noblogredirect/404 issue.

    I too have a multisite (subdomains) and originally defined noblogredirect as instructed on the network settings page when registration is disabled.

    The good news is that I’m not having any of the 404s on the subdomains redirected; but the main domain is another matter… all 404s on the main redirect to the front page vs. the 404 page. This is an issue with Google, apparently, which is interpreting these as “soft 404s” – a no-no.

    Deleting the noblogredirect definition fixes the problem on the local version of my multisite install – I get the expected 404 page on the main domain as well.

    Thus, this seems like an obvious and easy fix… but before I make it live, I thought I’d better double check to see if there are any issues with this that I’m not seeing. I want to keep user registration disabled AND get a normal 404 response. And since this particular multisite is a reproduction of what used to be a static HTML site, there shouldn’t be any issues with users visiting a non-existent site – there are zero plans to alter the existing site structure.

    Thoughts?

    Just as an FYI, I found this: https://core.trac.www.ads-software.com/ticket/21573 which led me to the fix suggested here: https://frumph.net/2010/06/05/wordpress-3-0-multisite-subdomain-installation-noblogredirect-behavior-fix/

    The fix in the last link is obviously dated… for example, I do not have a “mu-plugins” folder. But adding the line: remove_action( ‘template_redirect’, ‘maybe_redirect_404’ ); to my child theme functions page on my local site seems to work.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Make an mu-plugins folder, then, and put that line of code in a php file.

    The mu-plugins folder is not default created by WP, but you can use it so if you ever change your theme it’ll stick.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘404 page not working after setting Noblogredirect’ is closed to new replies.