WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a site with WordPress located in a directory under the root. The root directory contains the main files for the non-WordPress part of the site. Wordpress is included in all of these pages by inclusion of wp-load.php and this is working fine.

My question is about how best to handle 404 errors generated in this external part of the site. I'd like to have a single 404 page and ideally to use the WP 404 page for this purpose.

Is this possible and does anyone know how it could be accomplished?

share|improve this question
up vote 2 down vote accepted

Set the WordPress index.php as error handler in your .htaccess (if you are using Apache):

ErrorDocument 404 /wp/index.php

Make sure the path matches the path to the WordPress directory.

share|improve this answer
Thank you, that works perfectly! – Katherine Sep 20 '12 at 14:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.