簡單快速地制作404頁面_網(wǎng)頁設(shè)計教程
推薦:網(wǎng)站中應(yīng)避免出現(xiàn)彈出窗口Nottoolongago,seeingapop-upadappearmeantthatyouwereeitheronapagethatdistributedillegalsoftwareorlookingatsomethingthatisn't
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)問題時,服務(wù)器會提供404錯誤頁面。當(dāng)輸入的URL或者網(wǎng)址未被找到時,經(jīng)常出現(xiàn)的錯誤頁面是HTTP404“未找到”頁面。
This generally happens when a person clicks on a link for page that has been removed, renamed or otherwise changed.
假如點擊已移除、重命名或者已修改的網(wǎng)站鏈接,就會出現(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.
得到出錯信息之后,網(wǎng)站訪問者應(yīng)該如何做呢?一般來說,他們會迅速離開網(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.
其實,網(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.
但是,你可能會說,我沒有時間,也不知道如何制作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.
事實并沒有你想得那么復(fù)雜。你只要利用30分鐘的時間,利用Unix服務(wù)器,你可以很快完成。
Your Custom 404 Page Design
404頁面的設(shè)計方法
In my opinion your custom 404 error page should provide at least these four components:
我認(rèn)為,404錯誤頁面至少應(yī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.
指引用戶登錄免費產(chǎn)品或者免費服務(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地址等等,這樣可以讓用戶對網(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ù)器會根據(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)建一個(通常這個文件已存在,擁有FrontPage的服務(wù)器會自動創(chuàng)建這種文件)。當(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錯誤頁面的實際名稱所取代。)
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)時,可以插入主頁。假如這樣,添加到.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;假如不是,運用主頁的其它名稱把其代替。
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錯誤頁面,但錯誤文本的頁面應(yīng)該小于512bytes,否則程序會呈現(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ù)以上兩個簡單步驟,創(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.
最后需要介紹一點,在創(chuàng)建404錯誤頁面之前,閱讀網(wǎng)站服務(wù)器的FAQ或者其它要求,確保網(wǎng)頁可以發(fā)揮作用。
分享:網(wǎng)站設(shè)計中常犯的錯誤Themostcommonwebdesignmistakeistodesignfortheexception,andtoignoretheobvious.That'sbecausedesigningfortheobviousisboring,whi
- 中國互聯(lián)網(wǎng)黑色產(chǎn)業(yè)人數(shù)近10萬 5分鐘1起網(wǎng)絡(luò)入侵
- 馬云最后的發(fā)布會:打假,打出阿里的新未來
- 實踐分享:ACCESS數(shù)據(jù)庫導(dǎo)入mysql數(shù)據(jù)庫
- ACCESS數(shù)據(jù)庫轉(zhuǎn)ORACLE數(shù)據(jù)庫分享
- CDN.net免費CDN申請使用教程:100GB流量香港日本新加坡節(jié)點
- WordPress 教程:為插件自定義數(shù)據(jù)表
- 如何使用查找我的iPhone教程
- 微信公眾平臺教程(二) 消息管理與群發(fā)
- 中國IPv4地址今年將告罄 IPv6期待打破政策局
- 移動廣告野蠻成長:75%投放在iOS平臺
- 災(zāi)難面前,互聯(lián)網(wǎng)公司可以如何做的更好?
- 富士康500萬部iPhone遭蘋果退貨 損失10億元
- 相關(guān)鏈接:
- 教程說明:
網(wǎng)頁設(shè)計教程-簡單快速地制作404頁面
。
