建站常識(shí)
簡單快速地制作404頁面
2008-02-17 15:28:00
By design, the server that hosts your web site delivers a 404 Error / Page Not Found when a surfer clicks on a link that the server cannot find or something else unexpected happens. The most common error page is the HTTP 404 "Not found: The requested URL/whatever.html was not found on this server."
當(dāng)訪問者鏈接服務(wù)器不能提供的頁面,或者網(wǎng)絡(luò)出現(xiàn)問題時(shí),服務(wù)器會(huì)提供404錯(cuò)誤頁面。當(dāng)輸入的URL或者網(wǎng)址未被找到時(shí),經(jīng)常出現(xiàn)的錯(cuò)誤頁面是HTTP404“未找到”頁面。
This generally happens when a person clicks on a link for page that has been removed, renamed or otherwise changed.
如果點(diǎn)擊已移除、重命名或者已修改的網(wǎng)站鏈接,就會(huì)出現(xiàn)404頁面。
What happens to your web visitor who got that error message? Generally speaking they're off faster than a "speeding bullet" looking for the information they were seeking - probably to a different website. That's something you really don't want to have happen and it can be prevented with a custom 404 error page that gives them options on the error page that will tell them how to find what they were looking for.
得到出錯(cuò)信息之后,網(wǎng)站訪問者應(yīng)該如何做呢?一般來說,他們會(huì)迅速離開網(wǎng)站,轉(zhuǎn)而登錄其它網(wǎng)站尋找所需信息。我想你肯定不希望發(fā)生這種事情,那么你可以創(chuàng)建404頁面,引導(dǎo)用戶找到所需的內(nèi)容。
So the answer is? Create your own custom 404 Error page that suggests other resources on your site and then helps redirects that person to them.
如何解決呢?創(chuàng)建404頁面,引導(dǎo)用戶找到所需信息。
In essence you're capturing traffic that you had, but lost and didn't know it, and keeping that visitor by helping them find what they need and possible turn them into a buyer for your product or service later on.
其實(shí),網(wǎng)站正在盡力挽留流失的訪問者,幫助他們找到所需信息,并且盡可能把他們轉(zhuǎn)化成網(wǎng)站產(chǎn)品或服務(wù)的購買者。
But "I don't have the time or know how to make a custom 404 page", you say.
但是,你可能會(huì)說,我沒有時(shí)間,也不知道如何制作404頁面。
Well good news - it's not as hard as you think. If you have about 30 minutes and your server is a Unix web server then it's virtually a snap to do.
事實(shí)并沒有你想得那么復(fù)雜。你只要利用30分鐘的時(shí)間,利用Unix服務(wù)器,你可以很快完成。
Your Custom 404 Page Design
404頁面的設(shè)計(jì)方法
In my opinion your custom 404 error page should provide at least these four components:
我認(rèn)為,404錯(cuò)誤頁面至少應(yīng)該包含以下四項(xiàng)內(nèi)容:
A statement that the requested page was not found.
陳述頁面未找到。
Description of why the page may be missing.
介紹沒找到頁面的原因。
A site search box for the surfer to look for other pages on your site.
提供搜索框,確保訪問者登錄網(wǎng)站其它頁面。
A "plug" for one of your Free products or services.
指引用戶登錄免費(fèi)產(chǎn)品或者免費(fèi)服務(wù)網(wǎng)頁。
You can of course add other components like simple java script code for date & time and IP address display, etc. if you really want to impress someone with your technical wizardry.
當(dāng)然,你可以添加其它內(nèi)容,比如說簡單的java script編碼以及IP地址等等,這樣可以讓用戶對(duì)網(wǎng)站技術(shù)留下深刻的印象。
Your page also should carry the look and feel of your web site, so you should include your header or footer or both so it is clearly branded as yours. You may wish to include some other links for your site that lead visitors to other pages you may want them to visit.
404網(wǎng)頁應(yīng)該與網(wǎng)站外觀、風(fēng)格一致,所以應(yīng)該包括頁眉、頁腳或者兩者兼有,這樣才能保持網(wǎng)站特征?;蛟S你希望網(wǎng)頁設(shè)置其它鏈接,引導(dǎo)訪問者進(jìn)入你希望他們進(jìn)入的頁面。
Here are the basic steps:
基本步驟
The simplest method is to create your new custom page, then upload it to your site in the same folder where your home page is located. Servers vary in their requirements. For mine the page must have a specific name for it to function properly as my custom 404 error page.
最簡單的方法就是頁面創(chuàng)建完畢后,上傳到包含主頁的文件夾中。服務(wù)器會(huì)根據(jù)需求不斷變化,我認(rèn)為404頁面必須有特殊名稱,可以正確發(fā)揮作用。
If you don't have an .htaccess file you need to create one in the same folder where your home page is stored, (in some cases, the file may already exist; on servers with FrontPage extensions this file is automatically created). You'll need to do a simple edit in this file. Use your text editor or server editito to add the following command:
如果沒有.htaccess文件,你需要在包含主頁的文件夾中創(chuàng)建一個(gè)(通常這個(gè)文件已存在,擁有FrontPage的服務(wù)器會(huì)自動(dòng)創(chuàng)建這種文件)。當(dāng)然,你需要對(duì)文件稍做改動(dòng),利用文本編輯器或者服務(wù)器編輯工具,增加以下命令:
ErrorDocument 404 /filename.html
(where "filename.html" is replaced by the name of the actual file you want to appear as your Custom 404 Error page.)
(這里"filename.html"被404錯(cuò)誤頁面的實(shí)際名稱所取代。)
You could, if you prefer, to insert your home page when a 404 error occurs. In that case, the correct command to add to your .htaccess would be:
404頁面出現(xiàn)時(shí),可以插入主頁。如果這樣,添加到.htaccess文件的正確命令就是:
ErrorDocument 404 /index.html
The above example assumes your home page is named index.html. If not, replace it with whatever name you are using for your home page instead.
上述例子中,我們假設(shè)主頁被命名為index.html;如果不是,運(yùn)用主頁的其它名稱把其代替。
If you use Microsoft Internet Explorer and the option to Show friendly HTTP error messages is enabled, the file size of your custom error page must be no less than 512 bytes to function properly. Otherwise, the program will show a generic message.
如果使用Microsoft Internet Explorer,你可以正確顯示HTTP錯(cuò)誤頁面,但錯(cuò)誤文本的頁面應(yīng)該小于512bytes,否則程序會(huì)呈現(xiàn)一些普通信息。
There you have it. Design your page, follow the two simple steps above and you'll soon have your own custom 404 error page that will capture lost visitors and keep them on your site.
現(xiàn)在,你可以根據(jù)以上兩個(gè)簡單步驟,創(chuàng)建可以挽回網(wǎng)站訪問者的404頁面。
One final note - before you start on setting up your own custom error page check the FAQ or knowledgebase for your website's server for the specific requirements for making sure your new page works.
最后需要介紹一點(diǎn),在創(chuàng)建404錯(cuò)誤頁面之前,閱讀網(wǎng)站服務(wù)器的FAQ或者其它要求,確保網(wǎng)頁可以發(fā)揮作用。
近期更新
- [2023-06-25 23:22:29] 優(yōu)秀網(wǎng)站設(shè)計(jì)的五大特點(diǎn)
- [2023-04-27 14:05:55] Html 5 響應(yīng)式網(wǎng)站設(shè)計(jì)制作
- [2023-04-10 11:07:30] 網(wǎng)站建設(shè)制作流程知多少
- [2022-10-14 10:11:30] 做網(wǎng)站設(shè)計(jì)應(yīng)該更看重框架搭建還是視覺觀感?
- [2022-08-09 15:57:48] 以“產(chǎn)品”思維搭建網(wǎng)站!
- [2022-08-08 09:12:57] 一家公司的網(wǎng)站應(yīng)該有哪些板塊內(nèi)容?
- [2022-08-05 09:28:06] 企業(yè)網(wǎng)站建設(shè)為什么要設(shè)置新聞板塊?
- [2022-07-04 15:58:06] 網(wǎng)站首頁設(shè)計(jì)的好看,這個(gè)網(wǎng)站就成功了一大半!
- [2022-05-20 09:34:19] 網(wǎng)站后臺(tái)管理系統(tǒng)是什么?有什么作用?
- [2022-05-17 11:29:32] 作為消費(fèi)者,應(yīng)該如何選擇一家水平高的網(wǎng)站建設(shè)公司
- [2022-05-17 11:27:01] 高端網(wǎng)站定制與模板化網(wǎng)站應(yīng)該怎么選擇?
- [2022-04-22 16:00:41] 現(xiàn)在高端的網(wǎng)站設(shè)計(jì)都有哪些新的趨勢?
延伸閱讀
解決方案
輪胎行業(yè)網(wǎng)站設(shè)計(jì)解決方案 機(jī)械行業(yè)網(wǎng)站設(shè)計(jì)解決方案 房地產(chǎn)行業(yè)網(wǎng)站設(shè)計(jì)解決方案 科技企業(yè)網(wǎng)站設(shè)計(jì)解決方案 電子家電網(wǎng)站設(shè)計(jì)解決方案 食品行業(yè)網(wǎng)站設(shè)計(jì)解決方案 集團(tuán)公司網(wǎng)站設(shè)計(jì)解決方案 企事業(yè)單位網(wǎng)站設(shè)計(jì)解決方案 外貿(mào)行業(yè)網(wǎng)站設(shè)計(jì)解決方案 健身運(yùn)動(dòng)網(wǎng)站設(shè)計(jì)解決方案 美容與化妝品網(wǎng)站設(shè)計(jì)解決方案 建筑設(shè)計(jì)行業(yè)網(wǎng)站設(shè)計(jì)解決方案 物流行業(yè)網(wǎng)站設(shè)計(jì)解決方案
TAGS關(guān)鍵字
高端網(wǎng)站設(shè)計(jì) 青島網(wǎng)站優(yōu)化 青島不錯(cuò)的英文網(wǎng)站建設(shè)公司 企業(yè)建站 網(wǎng)站優(yōu)化 官網(wǎng)網(wǎng)站建設(shè) 插畫 H5專題頁面 網(wǎng)站制作 微網(wǎng)站 網(wǎng)站視覺 網(wǎng)站改版 中小型企業(yè)網(wǎng)站建設(shè) 頁面設(shè)計(jì) 蘋果系統(tǒng) 網(wǎng)站品牌 企業(yè)網(wǎng)站為什么要備案 高端輪胎網(wǎng)站設(shè)計(jì) 網(wǎng)站設(shè)計(jì) 青島網(wǎng)站營銷 企業(yè)網(wǎng)站 青島網(wǎng)站設(shè)計(jì)哪家好 青島網(wǎng)頁設(shè)計(jì) IT資訊 青島網(wǎng)站建設(shè)公司哪家好 網(wǎng)站設(shè)計(jì)資訊 青島抖音小程序開發(fā) 青島網(wǎng)頁制作 官網(wǎng)建設(shè) 扁平化設(shè)計(jì)