Support » Fixing WordPress » Is it possible to have two types of 404 errors? per directory?

Viewing 4 replies - 1 through 4 (of 4 total)
  • I tried:

    ErrorDocument 404 custom/404.html

    within the .htaccess file but nothing happens… Plus I think that would just override everything to 1 404 page, not the two that I want?

    That’s not the way to do it.

    The best way that I can think of is to set up some conditions in your existing 404 page that can check to see if the page/post/cateogry/taxonomy/etc is in the list that you want to target. if it is, show them the second content, and if not show the first content.

    Not sure what you mean by that…

    I created another .htaccess with ErrorDocument 404 /custom/404-old.php

    and placed it in the /custom/ folder but it still shows the generic 404 template.

    I said… That’s not the right way to do it. Because of the standard WP .htaccess rules, any 404 errors are handled by the WordPress system so your server will never see yur additional 404 document.

    To set it up, look at what’s in your current 404.php file in your theme. In there there will be a few checks, and some code to display whatever error notice that there is now. My suggestion was to use some of the WP functions to check what the user expected and display content based on that. It will take a bit of programming still, and a few trial and error attempts because you’ll always figure out something that’s not owrking quite the way that you wanted it to.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Is it possible to have two types of 404 errors? per directory?’ is closed to new replies.