WordPress.org

Ready to get started?Download WordPress

Forums

404 page not showing (12 posts)

  1. M1chel
    Member
    Posted 4 years ago #

    Hi,
    I customized the 404 page with something better then the usual message, but when I tried a random address to display the page I found out that it redirects me directly to the archive and not to 404.php

    How can I modify this?
    I took a look at my dashboard and there was no setting for this (at least I didn't find any) and I don't know exactly where to look in the template files. I thought it would have been in the index.php but I found nothing referring to this.

    Can someone help?

  2. M1chel
    Member
    Posted 4 years ago #

    hey guys,
    no one can help?

    My problem changed a bit. I put the path to the page in my .htaccess file and now it shows up when I type a fake url, but it's like it isn't part of wordpress.

    It doesn't retrieve the header and the footer saying

    Fatal error: Call to undefined function get_header() in C:\wamp\www\wordpress\wp-content\themes\default\404.php on line 9

    template tags don't work.

    what's the problem?

  3. M1chel
    Member
    Posted 4 years ago #

    Up!

    really, no suggestion? I can't believe anyone ever customized its 404 page..

    please, it's quite important.
    thanks :)

  4. M1chel
    Member
    Posted 4 years ago #

    hey, does anybody knows why my 404 page doesn't work?
    I created a normal 404.php file which should displayed when a wrong url is used and I checked in the index file, there is the is_404 tag, so everything should work.
    but it doesn't, my page never shows.

    and if I put the path to the 404 directly into the .htaccess file then it shows but withut header, footer, search and so on. it's like it doesn't uses wordpress tags and it's not connected to the rest of the blog.

    in case no-one has an answer (like in the previous 2 weeks) there's any other place here in wordpress where I can get support?

  5. mrdthomas
    Member
    Posted 4 years ago #

    When you say you customized the 404 page do you mean the default page or did you create a new one?

    Did you follow the instruction on this site for customizing 404 pages?

    What exactly did you do to cause this problem? If you use the default 404 page with customizations does it work?

  6. M1chel
    Member
    Posted 4 years ago #

    By customizing I mean that I created a new one.
    Yes, I followed the documentation and I tried to read it several times to see if I was missing something and I can't spot the error.
    I wrote my 404 upon the default one but it doesn't change much because the default is like any other template page with header, footer, and the 404 message.
    mine is the same with more features and a better message.
    but the structure didn't change.

    however even if I put the default 404 back in the theme it doesn't work, I get a standard error page from the server.
    looks like wordpress doesn't handle at all the error.

    if instead I insert the path of my error page in the .htaccess then the server use it, but it's like is not related to wordpress and my header, footer, search form aren't working, neither the stylesheet.

  7. Is your 404 page named 404.php ? As far as I know, WordPress will default a 404 to a template page named 404.php without an help from htaccess.

  8. M1chel
    Member
    Posted 4 years ago #

    yes, my page is named 404.php
    and 404 is also the name I used inside as "template name".

    is this correct?

  9. Yes, should work. What's in your htaccess for error pages? Anything? With a 404.php, I think nothing else is required in htaccess.

    Your web host might also have a system wide 404...

    Puzzle....

  10. M1chel
    Member
    Posted 4 years ago #

    Well, if I state the whole path to my 404 page in .htaccess file then it displays it in case of an error, but it's like it is not related to wordpress.. there's no header nor footer even if I put the tags.
    And it has no styles coz the link to the style sheet is in the header.

    If I can't solve this I'll probably put in the 404.php the code that I use in the header and in the footer instead of tags, but still everything dinamic that is related to wordpress won't work.
    And the worst part is that then I can't obviously put a search form.
    really annoying.

    I guess I'll do my best to deal with it.
    But If someone has any suggestion is appreciated.
    I'll keep this topic up to see if we can solve the problem.

    Thanks to everyone tried so far :)

  11. You're still getting the generic 404 page from your web host provider.

    What I do for an error page is make a WordPress page titled "Error" (with or without a special page template) and then add my own custom text, such as a search form, and then the page has the full styling and layout of my site. Then I call it in my htaccess file:

    ErrorDocument 401 http://example.com/error/
    ErrorDocument 403 http://example.com/error/
    ErrorDocument 404 http://example.com/error/
    ErrorDocument 500 http://example.com/error/

    You'll might also need to use a plugin like exclude-pages to exclude the error page from navigation menus, unless you have hardcoded menus.

  12. M1chel
    Member
    Posted 4 years ago #

    it didn't worked for me. it's basically what I also did before.
    I mean, yeah it finds the page but any "include" tag of wordpress generates a fatal error.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags