WordPress.org

Ready to get started?Download WordPress

Forums

not found page (6 posts)

  1. brecht.billen
    Member
    Posted 5 years ago #

    How can I change the content of my not found page (Sorry, but the page you requested cannot be found) on my blog? I want to give instructions on that page to my visitors.

  2. buddha trance
    Member
    Posted 5 years ago #

    You can create a custom error page, with this tutorial
    http://codex.wordpress.org/Creating_an_Error_404_Page

    If your theme already comes with one, and you simply want to edit it, look for 404.php in your theme folder.

  3. brecht.billen
    Member
    Posted 5 years ago #

    The not found page that I mean is not the 404 error page but this page: http://photoprints.be/?p=489 You get it when you (for example in google) click on a post that I deleted.

  4. buddha trance
    Member
    Posted 5 years ago #

    Unless I am missing something... the 404 page is the 'not found' page.
    The one you created as an example, is just a regular page, not a special template. You have to create the template and upload it in your theme folder. And it has to be called 404.php (it will look like the page you created, custom header and footer, and all).

    I think that's a page, because I did not see the response headers. If you already have the custom 404.php file in your theme folder, that's how you change it and add content. By editing the file directly.

    If you are talking about a 410 error (page gone), you can create a custom 410.php, or create a 404 page that will handle the other errors. I posted about this here http://www.buddhatrance.com/rethinking-the-404-page-in-wordpress

  5. brecht.billen
    Member
    Posted 5 years ago #

    I think I have 2 not found pages on my blog :-s When you use the search form at my website and there are no results, you get the 404 page whit this text (standard in my theme):

    Not Found

    Sorry, no posts matched your criteria.

    So, I made a 410 error page (I used the same script as the 404, just change the name) and still the error page for a post that doesn't exist anymore you get:

    Not Found

    Sorry, but the page you requested cannot be found.

    What kind of error page is this and how can I change it?

  6. buddha trance
    Member
    Posted 5 years ago #

    For a 410 error (page gone, something that existed before and that you deleted), you have to tell Google. Otherwise the search engine won't know if it's a typing error, a file that never existed in the first place, or a file that no longer exists.

    You do so in your .htaccess file

    Redirect gone /file1.php
    Redirect gone /file2.php
    Redirect gone /directory1/file1.php
    Redirect gone /directory2/file2.php
    Redirect gone /entire-directory/
    Redirect gone /path-to-directory/entire-directory2/
    
    ErrorDocument 410 /index.php?error=410

    For a post (depending on your permalinks)

    Redirect gone /your-permalink-structure/post-url
    Redirect gone /post-url
    
    ErrorDocument 410 /index.php?error=410

    You also add to the .htaccess file
    ErrorDocument 410 /index.php?error=410

    This will pull the custom 410.php error, when trying to access the gone url.
    In 410.php you will tell that the file is gone forever (instead of not found)

    Unless you have directives in your .htaccess file, you will get the generic "not found" 404 page.

    Hope this helps.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.