• I understand that if you have a theme with a 404 page you can use that to customize but what if you don’t want wordpress to use the 404 page that comes with the them and just want to use your own is there a way to prevent wordpress from calling the 404.php page within the theme?

Viewing 3 replies - 1 through 3 (of 3 total)
  • I think you might be able to just add an ErrorDocument line to your .htaccess.

    ie… ErrorDocument 404 /path_to_local_file/filename.php (or html)

    I’m not sure whether or not you will need to rename, or delete the theme’s custom 404 page. Here is a reference for custom 404 page in WordPress, if that’s any help.

    You can hook the ‘404_template’ filter and return the path to the template you want it to use or false if you don’t want any output.

    function override_404_template( $template ) {
      return '/var/www/errors/404.php';
    }
    
    add_filter('override_404_template', '404_template');
    Thread Starter Xfactory

    (@xfactory)

    Do I delete the themes 404 ? I have already created a custom 404 error page. Dave, where do those lines of code go my HTACCESS so I can try see if it works?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom 404 not involving wordpress’ is closed to new replies.