Forums

[resolved] Can WordPress leave my 404 alone? (5 posts)

  1. Brandon Wang
    Member
    Posted 2 years ago #

    WordPress throws up my theme's 404 page, but I don't want it to. Deleting the 404 page only gives me the default WordPress 404.

    I have a sitewide 404 page I have constructed that looks great, but I don't want to have duplicate code. Any way to get WordPress to stop taking over 404s?

  2. fldtrace
    Member
    Posted 2 years ago #

    open your 404.php file from your active theme directory and customize it the way you want it.

  3. Brandon Wang
    Member
    Posted 2 years ago #

    Well, I know that, but I have a site-wide 404 page defined by my own .htaccess, and it works everywhere except my /blog/ directory. Instead of duplicating code, I want WordPress to leave 404s alone and have ME handle them.

  4. Otto
    Tech Ninja
    Posted 2 years ago #

    No, you can't do this. Why? Because if you're using "pretty" permalinks, then all the URLs are actually referencing files and folders that are not physically there. WordPress has to intercept them in order to get the page and display it.

    Make your theme's 404.php redirect or include your site-wide 404 instead.

  5. Brandon Wang
    Member
    Posted 2 years ago #

    Ugh, I'm not dumb, I know what pretty permalinks are, but obviously there's no way for WordPress to just ignore pages that aren't there (but take over posts, etc).

    Thanks anyway.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags