如果我请求一个类似http://url/T%C3%A4st (http://url/Täst)页面,我的Apache-Error页面会显示错误的编码,例如:
在此服务器上找不到请求的URL /Täst。
<!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>
这怎么解决?
这听起来像你的错误页面需要指定的字符集。 您可以更改Apache httpd.conf文件:
http://rackerhacker.com/2007/11/15/change-the-default-apache-character-set/
或者,您可以将此标题添加到错误页面:
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
如果您不确定使用什么字符集,请尝试使用utf-8或ISO-8859-1。