404 not loading (4 posts)

  1. Cvltvs
    Posted 8 years ago #

    The 404 page of my template does not load. The code instructs it to get the header, footer etc., and leave an instruction for the user to "Use the search feature to find what you're looking for or use the contact page." with links to the Search and Contact features. But when I deliberately hit a 404, say at http://www.cvltvs.com/asdf I get a white page that says the page is not found on the server, as you can see. No theme and no customisation.

    I have read the codex regarding custom and creation of 404s, but that doesn't help. The server isn't going to my 404 page at all. I don't have access to the server itself as I'm using a host, so I can't access the .htaccess files. I've also searched through this forum, but none of the advice given to others helps me out.

    Any ideas anyone?

  2. jeeremie
    Posted 7 years ago #

    Same here.

    Could someone answer?

  3. jeeremie
    Posted 7 years ago #

    Actually, if I type http://www.mysite.com/page-dont-exist.html, it will display this message:

    Not Found

    The requested URL /page-dont-exist.html was not found on this server.

    but if I type http://www.mysite.com/index.php/page-dont-exist.html, it works! I am redirected to my custom 404.php page (where I have added a search form, categories, most popular posts...).

    So the question is how to make sure visitors are being redirected to my custom 404 error page no matter what. Should I create a .htaccess, and if yes, how?

    Any ideas?

  4. jeeremie
    Posted 7 years ago #

    I found the solution. We need to add the following line to .htaccess:

    ErrorDocument 404 /index.php

    That's all. It seems to work fine.

    /index.php is the relative path to your wordpress. If it doesn't find a page or post, it redirects you custom error page (404.php) in your wordpress theme.

    If, like me you, don't know much about how to create custom error pages, you should check this website http://www.4webhelp.net. It is an excellent article about "Creating Custom Error Messages in Apache".

    Also check http://www.alistapart.com/articles/perfect404/. They give some good tips.

Topic Closed

This topic has been closed to new replies.

About this Topic