Create custom PHP error pages in cPanel without redirecting them away from the page that has thrown the error

Trainee Asked on October 12, 2019 in Cpanel.
Add Comment
1 Answer(s)

The fact that the above is not working for you means one of several things:

  1. You are doing it wrong and still specifying the full URL even though you claim not to be.
  2. Cpanel is adding the full URL (not sure how you edit the .htaccess file or if it’s done via above GUI).
  3. Your .htaccess file is being ignored (perhaps because you are setting the values in the GUI or perhaps because FileInfo is not set at server level so this cannot be specified in .htaccess file (see here:, in which case it must be picking up the full URL itself from other config somewhere.
  4. The 500.php script is doing the redirecting itself (should be obvious from developer tools if preserve log and see if one page is returned or two).
  5. There is a bug in Apache (that I and others are not aware of).
  6. Magic

Can you check out those things?

Might also help to know what version of Apache you are on?

Also have you tried a plain 500.html file just to see if this works without redirecting? In theory a 500.php file should be fine too but would be interesting to narrow it down (and would also show if that change to 500.html was picked up and used or if it was still pointing to 500.php, which would perhaps show this was being picked up from other config than you think).

Reviewer Answered on October 12, 2019.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.