【问题标题】:HTTP 404 - File not found Internet Explorer V6HTTP 404 - 找不到文件 Internet Explorer V6
【发布时间】:2010-12-16 09:51:28
【问题描述】:

我有一个 404 代码,如果找不到该页面,它将重定向到该站点。它在Firefox中正常工作。但是,当我使用 Internet Explorer v6.该站点将收到错误消息:“HTTP 404 - 找不到文件 Internet Explorer”。我怎样才能解决这个问题?任何帮助表示赞赏

谢谢

【问题讨论】:

  • 那么,我们是否需要使用我们的心灵感应球体并直接从您的脑海中读取代码?

标签: php windows internet-explorer http-status-code-404


【解决方案1】:

尝试使用更长的 404 页面。这不是开玩笑。如果404页面小于512b,如果我没记错的话,IE会介入并显示它自己的错误信息。

添加一些 cmets 即可。

参考:http://www.reddit.com/r/web_design/comments/ee4zc/so_i_looked_at_plesks_404_page/

只是为了完整性:

<HTML>
<HEAD>
<TITLE>404 Not Found</TITLE>
</HEAD>
<BODY>
<H1>Not Found</H1>
The requested document was not found on this server.
<P>
<HR>
<ADDRESS>
Web Server at example.com
</ADDRESS>
</BODY>
</HTML>

<!--
   - Unfortunately, Microsoft has added a clever new
   - "feature" to Internet Explorer. If the text of
   - an error's message is "too small", specifically
   - less than 512 bytes, Internet Explorer returns
   - its own error message. You can turn that off,
   - but it's pretty tricky to find switch called
   - "smart error messages". That means, of course,
   - that short error messages are censored by default.
   - IIS always returns error messages that are long
   - enough to make Internet Explorer happy. The
   - workaround is pretty simple: pad the error
   - message with a big comment like this to push it
   - over the five hundred and twelve bytes minimum.
   - Of course, that's exactly what you're reading
   - right now.
   -->

【讨论】:

  • 哦,哇,好久没看到这个了,甚至在我自己的代码中也使用了相同的注释。
  • MYYN,我试过了,但它不起作用。它根本不重定向
  • 我想我修好了。我只是将我的 404.php 重新编码为: header("Location: yoursite.com"); /* 重定向浏览器 / / 确保当我们重定向时下面的代码不会被执行。*/ exit;
  • 对于 IE9,确切的值小于 512 字节(我昨天遇到了同样的问题,除了 500 错误)。无论如何,我使用 512 以防 IE8 使用。
猜你喜欢
  • 2019-05-03
  • 1970-01-01
  • 2017-12-15
  • 1970-01-01
  • 2011-02-20
  • 1970-01-01
  • 2011-06-11
  • 1970-01-01
相关资源
最近更新 更多