Defining a custom 404 for non-WordPress parts of site

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.

Read More

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

Related posts

Leave a Reply

1 comment

  1. 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.