I would like to produce a 404 error intentionally for some pages on my server, and I am currently working on the headers. The problem is, for the scripts that exists (and I give a 404 error in the script), the Content-Type
header field shows text/html; charset=UTF-8
, while for the real 404 pages the same field shows text/html; charset=iso-8859-1
, which defeats my purpose. I've tried adding AddDefaultCharset UTF-8
to the main config but there's no luck. The question is, how to set the charset on these real error pages?
Figured it out: Use
ErrorDocument
for the desired error code (in this case 404), make it point to a script under the web root, then setting whatever I like in theErrorDocument
.