Forums

Custom 404 Only Works for Certain Paths (8 posts)

  1. wrichter
    Member
    Posted 7 years ago #

    I noticed on other WordPress blogs, that if i do this http://www.theblogsURL.com/**** where **** is a made up bogus file or directory their custom WordPress 404 page will come up. If I do that on my website, the regular Apache 404 page comes up. But if I do http://www.myblogURL.us/feed/euhfuehfu I will get my blog's 404 page, not Apache's. Is something incorrectly configured?

  2. cavemonkey50
    Member
    Posted 7 years ago #

    I had that same problem. What I did was set the 404 page to blogurl.com/index.php/404 in .htaccess. It's not 100% correct but at least it's a temporary solution until someone finds the answer.

  3. wrichter
    Member
    Posted 7 years ago #

    Cool, I was trying to figure out how to pass that to index.php through htaccess.

  4. jborneman
    Member
    Posted 7 years ago #

    best place I can find for this question. I'm trying to create a custom 404 page. I made a template for 404 and created a page that exists at http://www.mydomain.com/404/ that has what I want to be my 404 page.

    I tried adding the following to my .htaccess
    ErrorDocument 404 http://www.mydomain.com/404/

    But everytime I go to a page that does not exist (this example, http://www.mydomain.com/nothere.html) I get the following:
    "Not Found
    The requested URL /nothere.html was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. "

    ANy ideas? AM I doing something really dumb?

  5. Michael Adams (mdawaffe)
    Member
    Posted 7 years ago #

    In .htaccess:
    ErrorDocument 404 /index.php?error=404

    Don't make Page Template for this, and don't make a Page pointing to it. Just name a file 404.php in your current theme's directory and put in whatever text you want to display on your 404 message directly in that template file.

  6. jborneman
    Member
    Posted 7 years ago #

    you're the man (or woman? either way, it worked :)! that worked great.

  7. Michael Adams (mdawaffe)
    Member
    Posted 7 years ago #

    (man)
    Glad it worked out :)

  8. courtneyelizabeth
    Member
    Posted 6 years ago #

    cool....thanks for this...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.