Home » Php » apache – 404 error not showing for pages ending in .php

apache – 404 error not showing for pages ending in .php

Posted by: admin February 25, 2020 Leave a comment


I have a 404 page set up for my website which works fine, for example see this page:


This was achieved by code in .htaccess file, as follows:

ErrorDocument 404 /no-such-url.php

However, if I go to any incorrect URL (i.e. URL which doesn’t exist) which also ends in .php, the 404 error page does not appear. See these for example:


Instead I get a blank page stating: “Content Encoding Error”.

From talking to Bluehost support it would seem that this is a problem with the apache server settings which I don’t know how to change. Bluehost expect you to manage and change settings on the apache servers yourself, at least on a VPS server which I have.

So 1) can I fix the above myself, e.g. through CPanel? and
2) Can you recommend a different hosting provider who has fast servers but also full support for php website and who will maintain the apache servers for me?

Many thanks,

How to&Answers: