Error 404 Page…

搬到 DreamHost 之後,由於我有變更 blog 文章的 archive(封存資料) 網址格式 。
導致之前被搜尋引擎扒走的頁面,或是其他 blogger 連結我文章,
就統統變成「無法顯示網頁」的 error 404 (找不到) 的訊息。

我照著虛擬主機的說明,做了自製化的 404 頁面,但是一直不生效,很幹。
昨晚,我又用了進階的方式,改了 .htaccess 的設定,但還是不生效,更幹!
上網用 Google 找了一下,我終於找到不生效的原因:

Force Internet Explorer to Display Your Custom 404

As you may know, Internet Explorer versions 5 and greater have their own 'friendly' error messages built in, so that you don't have to look at the ugly standard 404. However, some people who have designed their own custom 404s have found that IE is still ignoring their page and displaying its own message, which is likely not quite as helpful as the custom error. Silly Microsoft, always trying to do our thinking for us. Here's how to get around it - and it's simple!

IE looks at the size of the 404 page to decide whether to display its own error. All you have to do is make sure that the size of your file is greater than 512 bytes. This does not include graphics, so make sure you add enough text to accomplish this. (If you just need filler text, add a bunch of nonsense text in comments in the source code.)

大意是說,IE 5 以上的版本,會很「友善地」直接預設用 IE 自己的 404 頁面,真他 x 的賤!
破解的方法,就是把你的 404 頁面 k 數弄得超過 512 bytes,就會讓 IE 瀏覽器接受你的客製化頁面囉!

測試 "error 404 page":http://blog.planism.com/123.html

■ 延伸閱讀:

* 401 failed authorization
* 403 forbidden
* 404 missing file
* 500 internal server error

過去的同一天,我還發表了...

發佈留言