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 custom 400 error page trough cPanel. A 400.shtml file does get created in the directory, but it doesn't seem to get used in my case. So setting an error page in .htaccess then? Nope, no luck either.
How to reproduce (note the ö charter in the http header key pair, which is invalid).
Will return:
This might seem straightforward to achieve, but I have yet to accomplish this for my scenario. The obvious answer would be to create a custom 400 error page trough cPanel. A 400.shtml file does get created in the directory, but it doesn't seem to get used in my case. So setting an error page in .htaccess then? Nope, no luck either.
How to reproduce (note the ö charter in the http header key pair, which is invalid).
Code:
curl --request POST \
--url 'http://example.com' \
--header 'föö: bar' \
--data '' \
--include
Code:
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
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
</body></html>