• revenante

    (@revenante)


    Hello! I’ve searched for a while about this problem but haven’t found anything conclusive yet, so I’m coming to you.

    The problem: WordPress is hijacking my 404 pages. If I type in mysite.com/p87aw9m (or any other nonsense), it always appears as a WordPress page that says “Sorry, no posts matched your criteria.”

    I discovered that this was happening because my permalink structure was something other than the default (I think I was using the “Month and name” structure). When I changed the permalink structure back to Default (?p=123), WordPress magically stopped handling the 404 pages.

    My permalinks themselves are fine no matter what structure I use – I just find it very, very bizarre that using a structure other than the default makes WordPress take over my 404 pages. What gives? Is there any way to avoid this? I don’t particularly like the default permalink structure, but I also don’t like WordPress stepping in every time a page isn’t found. Help? Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • t31os

    (@t31os)

    See if this helps..

    http://thefire.us/archives/212

    Thread Starter revenante

    (@revenante)

    Thanks for the link! I tried that and it did help with the 404 error pages, but I’ve actually noticed something else.

    With a non-default permalink structure, WordPress doesn’t just take over 404 error pages, but other error pages as well, like 500 Internal Server errors. This is really bad because with WordPress taking over errors, I can’t tell what’s going on when I have problems, since all I see is the good old “Sorry, no posts matched your criteria.”

    I think this problem would go away if I installed my blog in a separate folder (not the root) and could store the .htaccess file in that folder, and not in the root of my domain. However, I want my blog to load on my home page so I don’t know any way around this. (I have my blog installed at /blog/ but I have WordPress loading it at root level. So I have index.php and .htaccess copied to my root directory. I think that’s what’s causing problems.)

    I saw similar problem with my site (version 2.9.1) however, it was hosted at the web root. It appears for us the problem was trying to define the following in both http.conf and .htaccess files.

    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    NB: Version quoted is formatted for a .htaccess file.

    Maybe you have something similar going on.

    We’ve kept the version in the .htaccess file and removed the other and all is well again.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WordPress hijacking 404 pages’ is closed to new replies.