Title: ErrorDocument problem
Last modified: August 18, 2016

---

# ErrorDocument problem

 *  [S.K](https://wordpress.org/support/users/kichu/)
 * (@kichu)
 * [21 years, 3 months ago](https://wordpress.org/support/topic/errordocument-problem/)
 * The 404 error page is not displayed out of the theme folder after changing to
   crust-free permalinks using mod-rewrite and putting in a .htaccess file with 
   the snippet shown on the admin page.
 * I have a 404.php in my active theme folder, but it is not being called in 404
   situations.
 * Pl help me
 * Regards
    S.K [http://blog.cyberbrahma.com/](http://blog.cyberbrahma.com/)

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [21 years, 3 months ago](https://wordpress.org/support/topic/errordocument-problem/#post-148529)
 * You need to add a line to .htaccess for this. Create the following line (using
   the correct path to your 404.php file) and add it to the .htaccess file in your
   site’s _root_ directory:
 * `ErrorDocument 404 /wp-content/themes/default/404.php`
 *  Thread Starter [S.K](https://wordpress.org/support/users/kichu/)
 * (@kichu)
 * [21 years, 3 months ago](https://wordpress.org/support/topic/errordocument-problem/#post-148533)
 * Thanks, macmanx.
 * But why not the error page be called, like it does in the case of /index.php?
   error=404 is my question!
 * When the query string is changed for other files, I think this 404.php also should
   be called likewise, as otherwise the paths to include files becomes a problem.
 * Hope I have stated my problem properly.
 * Thanks and regards
    S.K [http://blog/cyberbrahma.com/](http://blog/cyberbrahma.com/)
 *  [Ryan Boren](https://wordpress.org/support/users/ryan/)
 * (@ryan)
 * [21 years, 3 months ago](https://wordpress.org/support/topic/errordocument-problem/#post-148536)
 * `ErrorDocument 404 /index.php?error=404`
 * With that, if a mod_rewrite rule is not matched, Apache tells WP to load the 
   404 page for the active theme. The ErrorDocument line is not added to .htaccess
   by default.
 * If a mod_rewrite rule matches but the resultant query does not match any posts,
   WP loads the 404 template. If you use PATH_INFO permalinks and if either an internal
   rewrite rule doesn’t match or a query doesn’t resolve to any posts, WP loads 
   the 404 template.
 * There are several 404 scenarios, ErrorDocument in .htaccess only handles the 
   case where no mod_rewrite rules are matched.
 *  Thread Starter [S.K](https://wordpress.org/support/users/kichu/)
 * (@kichu)
 * [21 years, 3 months ago](https://wordpress.org/support/topic/errordocument-problem/#post-148537)
 * Correction :
    My blog URL:- [http://blog.cyberbrahma.com/](http://blog.cyberbrahma.com/)
 *  Thread Starter [S.K](https://wordpress.org/support/users/kichu/)
 * (@kichu)
 * [21 years, 3 months ago](https://wordpress.org/support/topic/errordocument-problem/#post-148544)
 * Thanks rboren.
 * <quote>If you use PATH_INFO permalinks and if either an internal rewrite rule
   doesn’t match or a query doesn’t resolve to any posts, WP loads the 404 template.
   </quote>
 * But I use PATH_INFO permalinks. And I expect the 404 template from the active
   theme folder to be loaded (when 404 situation occurs), but it doesn’t take place.
 * Now, in dummy’s terms, if PATH_INFO permaliks are opted, the default 404 template
   will not be loaded unless its path is defined in the errorDocument statement 
   of the .htaccess file.
 * Am I right in my postulate?
 * Regards
    S.K
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [21 years, 3 months ago](https://wordpress.org/support/topic/errordocument-problem/#post-148690)
 * No, actually I quoted the wrong ErrorDocument rule. Sorry for the confusion. 
   If permalinks are active, the .htaccess line should still be:
 * `ErrorDocument 404 /wordpress/index.php?error=404`
 *  [Tim Griffin](https://wordpress.org/support/users/tgriff/)
 * (@tgriff)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/errordocument-problem/#post-149213)
 * ok,
    there has to be a simple thing I am missing. in .htaccess I have: ErrorDocument
   404 /wp-content/themes/default/404.php
 * the error I continur to get is:
 * Fatal error: Call to undefined function: get_header() in ../../../../../../……
   default/404.php on line 1
 * Help?
 * Thanks!
    T
 *  [Tim Griffin](https://wordpress.org/support/users/tgriff/)
 * (@tgriff)
 * [21 years, 2 months ago](https://wordpress.org/support/topic/errordocument-problem/#post-149214)
 * Ok,
 * several attempts have resulted in success.
    .htacces required this:
 * ErrorDocument 404 /index.php?error=404
 * Now – no errors in the 404.php document!
    Yeah!
 * How many hours can it take to work something so simple out?
    Well, it was fun
   anyway 🙂
 *  [cynics](https://wordpress.org/support/users/cynics/)
 * (@cynics)
 * [20 years, 11 months ago](https://wordpress.org/support/topic/errordocument-problem/#post-149243)
 * Hi guys, i tried the ErrorDocument 404 /index.php?error=404 solution, but what
   happens is if i have a link that goes like [http://myhost.com/chicken](http://myhost.com/chicken)–
   it’ll show up a 404 page. but if i have a link that goes [http://mohost.com/chicken.php](http://mohost.com/chicken.php)–
   it says “No input file specified.” and not the 404 page.
 * if i didn’t have the ErrorDocument line, the server won’t redirect to the WP’s
   404 page in my theme but the generic 404 error message.
 * any suggestions?
 * thanks.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘ErrorDocument problem’ is closed to new replies.

## Tags

 * [htaccess](https://wordpress.org/support/topic-tag/htaccess/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 9 replies
 * 5 participants
 * Last reply from: [cynics](https://wordpress.org/support/users/cynics/)
 * Last activity: [20 years, 11 months ago](https://wordpress.org/support/topic/errordocument-problem/#post-149243)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
