簡(jiǎn)單快速地制作404頁(yè)面_網(wǎng)頁(yè)設(shè)計(jì)教程

      編輯Tag賺U幣
      教程Tag:暫無(wú)Tag,歡迎添加,賺取U幣!

      推薦:網(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èn)者鏈接服務(wù)器不能提供的頁(yè)面,或者網(wǎng)絡(luò)出現(xiàn)問(wèn)題時(shí),服務(wù)器會(huì)提供404錯(cuò)誤頁(yè)面。當(dāng)輸入的URL或者網(wǎng)址未被找到時(shí),經(jīng)常出現(xiàn)的錯(cuò)誤頁(yè)面是HTTP404“未找到”頁(yè)面。

      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頁(yè)面。

      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)站訪問(wèn)者應(yīng)該如何做呢?一般來(lái)說(shuō),他們會(huì)迅速離開(kāi)網(wǎng)站,轉(zhuǎn)而登錄其它網(wǎng)站尋找所需信息。我想你肯定不希望發(fā)生這種事情,那么你可以創(chuàng)建404頁(yè)面,引導(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頁(yè)面,引導(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)站正在盡力挽留流失的訪問(wèn)者,幫助他們找到所需信息,并且盡可能把他們轉(zhuǎn)化成網(wǎng)站產(chǎn)品或服務(wù)的購(gòu)買者。

      But "I don't have the time or know how to make a custom 404 page", you say.

      但是,你可能會(huì)說(shuō),我沒(méi)有時(shí)間,也不知道如何制作404頁(yè)面。

      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í)并沒(méi)有你想得那么復(fù)雜。你只要利用30分鐘的時(shí)間,利用Unix服務(wù)器,你可以很快完成。

      Your Custom 404 Page Design
      404頁(yè)面的設(shè)計(jì)方法

      In my opinion your custom 404 error page should provide at least these four components:

      我認(rèn)為,404錯(cuò)誤頁(yè)面至少應(yīng)該包含以下四項(xiàng)內(nèi)容:

      A statement that the requested page was not found.

      陳述頁(yè)面未找到。
      Description of why the page may be missing.

      介紹沒(méi)找到頁(yè)面的原因。
      A site search box for the surfer to look for other pages on your site.

      提供搜索框,確保訪問(wèn)者登錄網(wǎng)站其它頁(yè)面。
      A "plug" for one of your Free products or services.

      指引用戶登錄免費(fèi)產(chǎn)品或者免費(fèi)服務(wù)網(wǎng)頁(yè)。
      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)容,比如說(shuō)簡(jiǎn)單的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è)應(yīng)該與網(wǎng)站外觀、風(fēng)格一致,所以應(yīng)該包括頁(yè)眉、頁(yè)腳或者兩者兼有,這樣才能保持網(wǎng)站特征。或許你希望網(wǎng)頁(yè)設(shè)置其它鏈接,引導(dǎo)訪問(wèn)者進(jìn)入你希望他們進(jìn)入的頁(yè)面。

      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.

      最簡(jiǎn)單的方法就是頁(yè)面創(chuàng)建完畢后,上傳到包含主頁(yè)的文件夾中。服務(wù)器會(huì)根據(jù)需求不斷變化,我認(rèn)為404頁(yè)面必須有非凡名稱,可以正確發(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:

      假如沒(méi)有.htaccess文件,你需要在包含主頁(yè)的文件夾中創(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ò)誤頁(yè)面的實(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頁(yè)面出現(xiàn)時(shí),可以插入主頁(yè)。假如這樣,添加到.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è)主頁(yè)被命名為index.html;假如不是,運(yùn)用主頁(yè)的其它名稱把其代替。

      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ò)誤頁(yè)面,但錯(cuò)誤文本的頁(yè)面應(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è)簡(jiǎn)單步驟,創(chuàng)建可以挽回網(wǎng)站訪問(wèn)者的404頁(yè)面。

      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ò)誤頁(yè)面之前,閱讀網(wǎng)站服務(wù)器的FAQ或者其它要求,確保網(wǎng)頁(yè)可以發(fā)揮作用。

      分享:網(wǎng)站設(shè)計(jì)中常犯的錯(cuò)誤
      Themostcommonwebdesignmistakeistodesignfortheexception,andtoignoretheobvious.That'sbecausedesigningfortheobviousisboring,whi

      來(lái)源:w3pop.com//所屬分類:網(wǎng)頁(yè)設(shè)計(jì)教程/更新時(shí)間:2008-02-17
      相關(guān)網(wǎng)頁(yè)設(shè)計(jì)教程