WordPress.org

Ready to get started?Download WordPress

Forums

404 Not Found pages aren't displayed, just a blank page is shown (7 posts)

  1. Leon Ash
    Member
    Posted 4 years ago #

    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

  2. Leon Ash
    Member
    Posted 4 years ago #

    Mmmm ... just as I've posted this the 'behaviour' goes and changes.

    On Firefox 3.5 I get the 'blank' page, whereas on IE 8 I get the default IE 404 error?

    The logs still indicate intermittant premature end to processing. Some sort of timeout?

  3. Leon Ash
    Member
    Posted 4 years ago #

    At least I found a reason for the non-blank page on Internet Explorer.

    Thanks to perishable press for the details.

    Apparently IE uses its own 404 page if the 404 page being shown is too small.

    Now, still no idea as to why 404 displaying as blank.

    L

  4. Leon Ash
    Member
    Posted 4 years ago #

    Okay,

    I can confirm that this behaviour is the same on a completely fresh install of WordPress.

    By default WordPress doesn't seem to be able to 'process' Page Not found on my configuration. I've even tried different PermaLink structures to see if it makes a difference.

    If I configure a custom error page (/index.php?error=404) or an error handler (ErrorDocument 404 /index.php?error=404) in the .htaccess file I just get a blank page.

    So, the question becomes, why can't WordPress process and display /index.php?error=404 correctly?

    L

  5. Samuel Wood (Otto)
    Tech Ninja
    Posted 4 years ago #

    WordPress handles 404's just fine.

    Why are you defining a custom error page as /index.php?error=404 ?

  6. Leon Ash
    Member
    Posted 4 years ago #

    Hi Otto42,

    If I do not have an IIS6 custom error page set only the root of the site works ie the index template?

    If I add the custom handler as specified everything works as expected apart from the 404 pages that are 'blank'.

    I'm experimenting on http:/preview.tawnylion.com/ don't want to mess with the version at tawnylion.com.

    The preview site has vanilla wordpress installation. No plugins and using default theme, currently configured to use permalinks set to /%postname% has no htaccess file (no redirection) and the custom 404 error handler.

    All the links work as expected apart from when I 'call' an invalid url eg, http://preview.tawnylion.com/badurl

    L

  7. Leon Ash
    Member
    Posted 4 years ago #

    Okay,

    Just to complete this discussion. I upgraded to IIS7 hosting with IIS's rewrite module.

    Didn't have the problem at the beginning, but then noticed it at some stage. When comparing the default install to the actual install I found the following in wp-config.php as the 'only' difference.

    define('WP_MEMORY_LIMIT', '64M');

    After removing this the 404 pages started displaying again. Then I added the statement back and it still displayed.

    So, I don't actually know if this is the cause of the problem, but after removing it and then adding it back I seemed to have fixed the 404 pages not displaying?

    Leon

    L

Topic Closed

This topic has been closed to new replies.

About this Topic