The MU forums have moved to WordPress.org

NOBLOGREDIRECT prevents 404 template? (1 post)

  1. apatheticresistance
    Member
    Posted 13 years ago #

    Hi, I have a problem with how to handle bad URLs. I am using subdomain handling at http://qpirgmcgill.org

    Initially I had a 404 template that worked fine. But then I discovered that (even with registration closed on the Site Admin > Options page) if I go to a non-existent subdomain, it would give me the option of registering a new blog.

    1. So I went into wp-config and set NOBLOGREDIRECT to %siteurl%. This worked for mistaken subdomains. But then random URLs which previously went to the 404 template came up with a "The page isn't redirecting properly" message in Firefox... suggesting some sort of endless redirect.

    2. I hardcoded NOBLOGREDIRECT to http://qpirgmcgill.org. This solution worked for both mistaken subdomain URLs and random URLs. But now I can't use my 404 template? Everything just goes to the homepage.

    3. I read online that I should be able to go to index.php?error=404 to call the 404 template. So I tried setting NOBLOGREDIRECT to this hardcoded link, but it just loads the homepage as normal (although the URL is indeed http://qpirgmcgill.org/index.php?error=404

    I have the 404.php file in my theme directory, and as mentioned, it previously worked. So I'm not sure what's wrong.

    Does anyone have an idea of what's going on? Any suggested work arounds? Thanks so much for you help!

About this Topic

  • Started 13 years ago by apatheticresistance