404 Issues (Fasthosts/WordPress Bug)

Sorry if people have had issues with the 404 page behaving oddly of late…

It seems it was a problem with a bug with the way 404 pages for WordPress work on the Fasthosts servers (it causes only some of the page to be displayed). However, we found a fix, which is a very strange solution – and as there doesn’t seem to be a solution out there in Google-land I’ve posted it here incase it helps save people a hours of their life!

In the end I found that if I add 7,889 extra characters (just random letters) to the beginning of the 404.php file, then it works fine! It seems that the issue on the Fasthosts servers means that it is ignoring the first 7,889 characters in the file! So just filling those characters with rubbish means that when it gets read in, it misses out that amount of letters, leaving the rest of your correct code.

Odd stuff… But bloody glad it’s now working!






11 responses to “404 Issues (Fasthosts/WordPress Bug)”

  1. Rob Andrews Avatar

    Well done.

    This one has been bothering me for a while. I did also spot that it seemed to be skipping a number of characters and tried to put some in to fix this. However, I think I put in which did not work, than I gave up.

    Fasthost… you let your self down on this and a number of other issues (script time limit 30 seconds is my worst one).

  2. tony cook Avatar

    As you seem to be running wordpress with fasthosts have you come across pretty permalinks not working? I’m trying to get /%category%/%postname%/ to work as a custom permalinks but this just results in a fasthost 404 page – and not my custom 404 page (I have added the extra character like you suggest). After googling it it seems to have something to do with MS Internet Information Services (IIS), but the fixes I have found are far beyond my skills to do – I’m really not a coder.

    Two of my clients are with fasthosts and I’ve have nothing but problems. Luckily my first client has a linux server so I’m not getting the above error but we couldn’t get WP to email out without hacking the code in wp-includes\pluggable.php so it would work with fasthosts.

    If you have come across this, any “idiots guide” help would be great.

  3. Mikie Avatar

    Hey Tony, I set the permalinks to use the http://www.logoed.co.uk/2010/04/23/sample-post/ setup option, which is one of their standard options that is a lot nicer than the ?p=123 default. This has always worked perfectly – and to be honest haven’t tried to be able to get it working using the category setting. But I can’t see why it would be an issue, unless it can’t be done normally (I assume it can though).

    I think Fasthosts do mention that they recommend Linux rather than Windows to ensure that everything works properly (this site is on Linux).

    So no help from me I’m afriad!

  4. tony cook Avatar

    Thanks for getting back. My first client is on a linux server and pretty permalinks works perfectly fine (ie http://www.logoed.co.uk/sample-post/) but my other client has a MS server and it just 404’s on me, except for the homepage. It is a documented problem with fasthosts if you google it.

    You can get around it by setting the permalink links to: /index.php/%category%/%postname%/ which is not ideal as you end up with http://www.domain.co.uk/index.php/pagename instead of just http://www.domain.co.uk/pagename.

    Thanks anyway.

  5. Mikie Avatar

    Thanks for that update Tony – always helpful for the next poor soul trying to fix it!

  6. Darren Clark Avatar


    After completing a wordpress upgrade for a client I also came across this issue where the 404’s were showing a blank page with the header:

    “500 Server closed connection without sending any data back”

    After some testing I found that fasthosts will not allow the 404 header to be set as per:

    I therefore tested if other headers could be set and the next acceptable header for a 404 is a 410 Gone, which Google and other search engines will use as per:

    To use this modify your theme 404.php and add at the top of the file:

    Your error pages should be working properly and for SEO purposes only valid content is indexed correctly.

  7. Darren Clark Avatar

    Note, the php content was stripped from the post, for the full reply visit:

  8. Joff Avatar

    This has to be one of the craziest bugs I’ve seen and also one of the most frustrating to debug so thanks to the OP for coming up with a solution.

    For anyone wanting a quick string generator, I used http://textmechanic.com/Random-String-Generator.html but only generated 7875 characters, adding the HTML comment delimiters around it: .

    Incidentally, Darren’s fix is neater and possibly the more correct of the two methods to use 🙂

  9. Lewis Avatar

    Whoever figured this out is amazing. Ive been trying for ages to crack this. I must admit I didn’t think it was going to do work. I’m well pleased. Thanks so much.

  10. Trevor Mcinsley Avatar

    Fasthosts have been no help on this matter. Granted this was largely because I was unwilling to provide them with my FTP login details… customer support should never be asking for passwords.

    When I first read this I thought it was a joke. Indeed even when I tried it and it seemed to work I thought it must be a coincidence. To confound the issue further when I removed the 7889 characters from the 404 page it still displayed… but it didn’t update when I tried to change it. In fact it still displayed the 404 even after the link was deleted and my cache cleared.

    I have no idea how you discovered this fix, I can only surmise you were typing increasingly convoluted strings of swearwords into your 404.php file in a blind rage… but I thank you nonetheless. Finally I have the 404 page I desire (namely Godzilla stomping on Stonehenge… obviously).

  11. Janchi Avatar


    I had to use 7933 characters as I guess the number depends on the amount of code your header.php file spits?

    But seriously, this is a joke! Ridiculous! In more than 12 years that I have been building websites I have NEVER seen this before. Fasthosts, get your “poo” sorted.

    Thanks a lot mate!

Leave a Reply

Your email address will not be published. Required fields are marked *