404 Not Found pages aren’t displayed, just a blank page is shown
-
I’ve read many posts here with regards to the 404 pages being displayed as blank, but can’t seem to find anything that has resolved the problem.
And, I’m hoping there is someone here with another suggestion.
Setup
- IIS 6, PHP 5.2, Helicon ISAPI_Rewrite, and latest version of WordPress.
- Custom permalinks enabled as /%postname%/
- IIS 404 custom error page set to /index.php?error=404
- Debugging enabled
Problem:
All the links and corresponding pages work as expected, apart from invalid or bad urls, that should be displaying my 404 page. Instead I get a blank page. The header looks fine, ie. 404 Not Found, but the body doesn’t exist.Things I’ve Tried
- Disabled all plugins
- Reverted back to default theme
- Checked for ‘files’ with spaces at beginning and end
- Doubled the memory setting
Current situation
I’ve taken to putting error_log statements into all the entry/exit points of the various theme files.When browsing to an invalid page eg. badurl there appears to be 2 loops through the parse_query and theme files.
The first loop “detects” the badurl and returns the expected 404 Not Found response. Then IIS picks it up and calls index.php?error=404 that begins the second loop.
This is where the “strangeness” occurs. During this second loop the appropriate 404.php theme file is called, but it doesn’t get to finish. However, the logging stops at different places. For 6 attempts the log entries stop as follows:
- In theme header.php, leaving theme header
- In theme 404.php, after theme header
- In theme 404.php, after theme header
- In theme sidebar.php, entering theme sidebar
- In theme header.php, entering theme header
- In theme header.php, leaving theme header
This almost appears to be a timing problem, but for now I am stumped any suggestions for further investigation would be welcome.
Thanks
Leon
- The topic ‘404 Not Found pages aren’t displayed, just a blank page is shown’ is closed to new replies.