Ready to get started?Download WordPress


WordPress (or something) not generating 404's (9 posts)

  1. cloudmaster
    Posted 5 years ago #

    Apologies, but I just don't know where to post this (involves two different apps)

    WordPress 2.8.4
    Litespeed 4.0.9
    URL: http://www.thelake.me

    Problem: Whenever I type a non-existent URL on my blog I get the following text & according to Google Apps also get a 200 response rather than a 404

    Sorry, no posts matched your criteria.

    I've tried setting a custom error page in Litespeed but it's not being used, & I've no idea what's generating the posted text so don't know where to investigate further.

    Thanks for looking

  2. esmi
    Forum Moderator
    Posted 5 years ago #

  3. cloudmaster
    Posted 5 years ago #

    Thanks for the reply,

    I already have a (modified) 404.php shipped with the theme I use but WordPress isn't using it (according to these snippets from your link it should be)

    As I stated in my 1st post, all I get is 'Sorry, no posts matched your criteria.' with a 200 reponse rather than a 404 (no idea what's generating that text).

    'When a user clicks on a link to a missing page, the web server will send the user an error message such as 404 Not Found'

    'The normal 404.php page shipped with your Theme will work'

  4. esmi
    Forum Moderator
    Posted 5 years ago #

    Have a look at index.php and see if there's anything between the <?php else : ?> and the <?php endif; ?> near the bottom of the file.

  5. cloudmaster
    Posted 5 years ago #

    Ah!! we're getting somewhere, found this in the index.php of my theme -

    <?php _e('Sorry, no posts matched your criteria.'); ?>

    That explains where the text is being generated, I guess I should rewrite that line to call the 404.php page, but I've no idea how.

  6. esmi
    Forum Moderator
    Posted 5 years ago #

    Try taking just that line out.

  7. cloudmaster
    Posted 5 years ago #

    Well I think I'll have to mark this as unresolveable. Taking that line out just produces a blank area instead of that line.

    I've set a custome error page in Litespeed, but I guess if I can't get WordPress to generate 404's, that will never be used.

  8. S.K
    Posted 5 years ago #

    Check up if any 404 page is specified in the .htaccess file.


  9. cloudmaster
    Posted 5 years ago #

    I don't use a .htaccess file but I have got the following at the top of my rewrite rules in the Litespeed virtual server serving the site

    ErrorDocument 404/index.php?error=404?

    I've also got a custom 404 page set up in Litespeed pointing to my custom 404.php page

Topic Closed

This topic has been closed to new replies.

About this Topic