How to customize a 400 error page?
Whenever a request is made to my server (to any of the domains) with a invalid charter in the header key an error 400 is rightfully returned. I like to change the content of this error page for a specific sub domain. And I seem unable to.
This might seem straightforward to achieve, but I have yet to accomplish this for my scenario. The obvious answer would be to create a
curl --request POST \
--url 'http://example.com' \
--header 'f"": bar' \
--data '' \
--include
Will return:
Will return:
HTTP/1.1 400 Bad Request
Date: Thu, 12 Sep 2019 15:21:59 GMT
Server: Apache
Content-Length: 226
Connection: close
Content-Type: text/html; charset=iso-8859-1
400 Bad Request
Bad Request
Your browser sent a request that this server could not understand.
-
Hello, You can modify the error pages for a specific domain by going to WHM>>Advanced>>Error Pages -> Select Domain -> Edit Common Error Codes and select 400 (Bad request) 0 -
Hi @cPanelLauren, thank you, I know. However, unfortunately this doesn't work in the scenario described my previous post. The modified error page isn't used in this case. So the question remains; how do I change the error page for a specific (sub) domain for this scenario? 0 -
That should be the method to make this modification if it's not functioning as intended I'd assume a misconfiguration at some point. You should be able to set this for the specific subdomain, from that interface. If that's not working you might try adding the following into your .htaccess file for the domain: ErrorDocument 400 /400.shtml
If it still doesn't function properly I'd suggest opening a ticket so it can be investigated further0
Please sign in to leave a comment.
Comments
3 comments