2

If I request a page like http://url/T%C3%A4st (http://url/Täst) my Apache-Error Pages display with a wrong encoding, for example:

The requested URL /Täst was not found on this server.

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /Täst was not found on this server.</p>
<hr>
<address>Apache/2.2.16 (Debian) Server at example.com Port 80</address>
</body></html>

How can this be fixed?

Zulakis
  • 4,153
  • 14
  • 48
  • 76

1 Answers1

1

It sounds like your error page needs to specify the charset. You can either change the Apache httpd.conf file:

http://rackerhacker.com/2007/11/15/change-the-default-apache-character-set/

Or, you can add this header to the error page:

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

If you're not sure what charset to use, try either utf-8 or ISO-8859-1.

kmoser
  • 111
  • 2
  • Where can I find the default error pages? Setting AddDefaultCharset is not a good idea because it is going to force-overwrite all the meta http-equiv or xml encoding tags. – Zulakis Sep 26 '12 at 16:49
  • It depends on your Apache configuration. You can control how the server responds to errors: [Custom Error Responses](https://httpd.apache.org/docs/2.4/custom-error.html) – kmoser Dec 12 '16 at 03:36