Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.