We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18212
    • 6 Posts
    I have a ’page not found’ page for a website I am developing. It displays fine:
    http://www.breastfeedingnetwork.org.uk/pagenotfound.html

    I have added the page ID to the configuration settings for the error page, but when I test it, all that appears is the last few lines of text, with none of the template/css display operating. Try:
    http://www.breastfeedingnetwork.org.uk/poop.html

    I’ve not been able to find anything about this being a known problem. Any ideas?
      • 18212
      • 6 Posts
      Quote from: ganeshXL at Apr 23, 2009, 04:27 PM

      Try clearing the cache, or set the 404 doc to uncached.

      Also, you should fix the charset / encoding meta tag. The server sends utf-8 headers, but the HTML says iso-8859-1. This has nothing to do with the weird 404 page, but it doesn’t hurt to fix it smiley


      Thanks for the pointers. I’ve cleared the cash and set my pagenotfound.html document to uncached, but the behaviour is the same.

      I don’t know if it is relevant, but it previews fine in the back panel too. The same problem occurs if I set the error page to one of the pages not using the template/css file I’ve been working on.

      I’ll sort the charset / encoding meta tag as soon as I can.
        • 25038
        • 1 Posts
        Bumping this as I am a MODx newbie and have got this same error... Was there some sort of solution found? What I get is exactly the same as the OP - the error page when it is needed seems to start with the Long Title (H2), missing out everything above.

        The error page itself is fine, and previews perfectly in the manager.
          • 37126
          • 37 Posts
          Been scratching my head on this too something cuts off the header information preventing the 404 page displaying. Not found an answer yet
            • 8168
            • 1,118 Posts
            Did anyone solve this? I have the same issue... seems something odd is going on here!
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              The thing is, MODx should be overriding this; the server gets a request for somepage.html. It rewrites this to index.php?q=somepage.html. So the index.php calls the parser, which sees the "somepage.html" part, and the q= tells it this is an alias. So it goes to the database to look for the document ID of the resource with this alias. If it doesn’t find anything, it does a redirect to the Configuration-specified error page. The redirect code sets a header of "HTTP/1.0 404 Not Found", and loads up the designated error resource (or site_start if no designation is found), pulls it out of the cache or parses it as required and fires it off after the 404 headers. It also deals with the problem of the error page not being found, keeping track of the loops through the resource ID not being found, and eventually generates the infamous "ERROR: Too many forward attempts!</h1><p>The request could not be completed due to too many unsuccessful forward attempts." with a HTTP/1.0 500 Internal Server Error header.

              Much the same thing happens with the unauthorized page, but it uses a "HTTP/1.1 401 Unauthorized" header.

              I don’t know all that much about web server configuration, but it looks like somebody’s server is configured in such a way that it chokes on the "HTTP/1.0 404 Not Found" header. I suspect those forum posts about the failure of "secured" resources has a similar cause. And it’s something recent; either 1.0.2 made some small but significant change in the headers and forwarder functions, or a recent upgrade to Apache (or bind?) or IIS is buggy or misconfigured. I’m suspecting the latter, since we’ve gotten too many "My site was working fine, then all of a sudden today it does this..." posts.



                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 8168
                • 1,118 Posts
                Thanks Susan,

                So it’s likely a server thing is it? What do I need to ask them to sort out to enable this to work for me?



                Cheers,

                dubbs
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Ask them why a PHP-generated header of "HTTP/1.0 404 Not Found" would cause problems.
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org
                    • 8168
                    • 1,118 Posts
                    Thanks it seems this *poor* hosting does not allow it - they suggest using mod_rewrite instead? how would this be possible?
                      • 37126
                      • 37 Posts
                      Just an update on this one. I’ve since moved host from Fasthosts but found a workaround while googling that while a fudge works. By adding 7800 characters to the head of the 404 document before any html I was able to display the 404 page.