2010-12-16 99 views
2

我有昂贵的404代码,将重定向到该网站,如果该页面未找到。它在Firefox中正常工作。但是,当我使用Internet Explorer v6时。该网站将得到和错误mesaage:“HTTP 404 - 文件未找到Internet Explore”。我怎样才能解决这个问题?任何帮助表示赞赏HTTP 404 - 文件未找到Internet Explorer V6

谢谢

+2

所以,我们需要直接从你的头脑把我们的心灵感应领域和阅读的代码? – zerkms 2010-12-16 01:45:24

回答

13

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

添加一些评论会做。

参考: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. 
    --> 
+0

哦,哇,有一段时间没有见过这个,甚至在我自己的代码中沿着这条线使用了同样的评论。 – Scuzzy 2010-12-16 01:57:19

+0

MYYN,我试过了,但它不起作用。它根本没有重定向 – rayss 2010-12-16 02:04:02

+0

我认为我解决了它。我只是将我的404.php重新编码为:header(“Location:http://www.yoursite.com”);/*重定向浏览器*/ /*确保下面的代码在我们重定向时不会被执行。 */ 退出; – rayss 2010-12-16 02:12:58