WordPress.org

Ready to get started?Download WordPress

Forums

How to stop WP default 404 error (3 posts)

  1. PaulRitter
    Member
    Posted 8 years ago #

    Hi, I've got a WP site, and I've created several pages via the Admin panel to act as my error pages (400, 401, 403, 404, and 500). I've edited my sidebar.php file so that it will hide all the error pages from my main page (but they can still be visited via direct URL). I've setup my .htaccess file to redirect to these pages for each individual error type. But it seems when someone trys to access a page that doesn't exist (error 404) they get just a simple WP 404 error message. I think that WP has got a default 404 error page, and I think it's somewhere in the index.php file but I wanna make sure before I change anything.

    For example, here's the page you get when you try to access a page that doesn't exist: http://paul.buildtolearn.net/blog/fakepage.php
    And here's the page that I WANT it to show: http://paul.buildtolearn.net/blog/?page_id=52

    Help? Thanks! :)

  2. moshu
    Member
    Posted 8 years ago #

    Since you are using the default WP theme... a quick look at the theme folder would reveal the existence of a 404.php file :)

  3. PaulRitter
    Member
    Posted 8 years ago #

    I know, I've seen the 404.php file, but when I delete it and try to access a non-existant page, it just points to the index, not to my custom error page :?

Topic Closed

This topic has been closed to new replies.

About this Topic