Custom error page

Custom error page

A custom error page is a feature of most Web server software that allows you to replace default error messages with ones you create. The default error messages tend to be fairly generic, and not particularly user-friendly, so making custom messages for a site is recommended.

You can make them look more like the rest of a site, and/or provide better recovery navigation. The "Not Found" (404) error is the one users are most likely to encounter, so it is the most likely to be customized.

..::..Essa página que você está tentando acessar não existe..::..Visite nossa página principal em:
* [http://www.byfish.com.br]

Custom 404 error message examples

* [http://www.cnn.com/blah News site (with "dashboard" navigation)]
* [http://europe.nokia.com/EUROPE_NOKIA_COM_3/Sorry/ Corporation site (with search and random pictures)]

Creating custom error pages

The instructions below assume you have direct access to a Web server you set up. If your site is hosted by a third party, they may have already provided one or more default error pages. Check your host's documentation.

Custom error page creation using Apache HTTP Server

If you run a Web server using the Apache HTTP Server software, you can easily specify custom error pages through server configuration files such as httpd.conf or .htaccess. You can specify custom error pages using the ErrorDocument directive. It is used as follows:---- ## File paths are relative to the Document Root (/) # '404 Not Found' error ErrorDocument 404 /404.htm # '403 Forbidden' error ErrorDocument 403 /my.htm # '401 Unauthorized' error ErrorDocument 401 /401.htm # Or.. # ErrorDocument 401 "The webserver could not authorise you for content access.----This may be put in an .htaccess file, which can be created using a text editor. Everything defined in an .htaccess file will only take effect for the directory it is located in and its child directories.

It is important to note that the 401 error response must be a relative URL, beginning with a forward slash, /, or a comment, beginning with a double quote " due to the following in httpd_core.c :

if (error_number = 401 && line [0] != '/' && line [0] != '"') { /* Ignore it... */ ap_log_error (APLOG_MARK, APLOG_NOERRNO|APLOG_NOTICE, cmd->server, "cannot use a full URL in a 401 ErrorDocument " "directive --- ignoring!");

It's also very important that the 401 error response not only begins with a forward slash, there should also be no more than 1 (one) space between '401' and the forward slash /.

Custom error page creation using Microsoft IIS

#Use a text editor or an HTML editor to create your custom page on your server
#From your server's desktop, launch the Internet Services Manager (usually located at Start->Programs->Administrative Tools->Internet Services Manager)
#Click the [+] to the left of the server name
#Right-click on "Default Web Server" (or whatever you may have renamed it as), and click on "Properties"
#Click on the Custom Errors tab
#Click on the number of the HTTP Error you want to make the custom message for, then click "Edit Properties"
#Use the Browse button to locate the custom file you created and click OK. Keep clicking OK to dismiss the windows, then close the IIS window

External links

* [http://httpd.apache.org/docs-2.0/mod/core.html#errordocument ErrorDocument Directive] in Apache HTTP Server 2.0 documentation
* [http://www.servergrade.com.au/faq/answers/creating-customised-404.html Customised 404 Error Pages] Improving website usability with customised 404 error pages
* [http://www.plinko.net/404/default.asp 404 Research Lab] Exploring the art of the 404 page
* [http://www.bigoakinc.com/blog/error-pages/ Error Pages] How to use a 404 Error Page
* [http://www.customerror.com Custom Error for IIS] Commercial Software for Error Page management on IIS 4+
* [http://research.elabs.govt.nz/good-practice-for-404-error-pages Research e-Labs] An article on 404 error page good practice


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать реферат

Look at other dictionaries:

  • Time-Limited Error Recovery — (TLER) is a name used by Western Digital for a hard drive feature that allows improved error handling in a RAID environment. In some cases, there is a conflict whether error handling should be undertaken by the hard drive or by the RAID… …   Wikipedia

  • Screens of death — In many computer operating systems, a special type of error message will display onscreen when the system has experienced a fatal error. Computer users have dubbed these messages Screens of Death, as they typically result in unsaved work being… …   Wikipedia

  • Switch board (framework) — Switch Board is a MVC framework written for PHP. Its original concepts were taken from a preexisting ColdFusion/PHP framework called Fusebox. Its evolution through development has greatly changed its structure to have very little resemblance to… …   Wikipedia

  • Megaupload — Limited Megaupload.gif Type Limited Founded 2005 Headquarters Hong Kong Key people Kim Schmitz (CEO) Finn Batato (CMO) …   Wikipedia

  • HTTP 404 — For broken links in Wikipedia, see Wikipedia:Link rot HTTP Persistence · Compression · HTTPS Request methods OPTIONS · GET …   Wikipedia

  • Google's hoaxes — TISP redirects here. For the space program, see Teacher in Space Project. Google has a tradition of perpetrating April Fools Day hoaxes. Contents 1 April Fool s hoaxes 1.1 2000 1.2 2002 …   Wikipedia

  • JavaServer Pages — (JSP) is a Java technology that allows software developers to dynamically generate HTML, XML or other types of documents in response to a Web client request. The technology allows Java code and certain pre defined actions to be embedded into… …   Wikipedia

  • .jsp — JavaServer Pages, abgekürzt JSP, ist eine von Sun Microsystems entwickelte auf JHTML basierende Technik, die im Wesentlichen zur einfachen dynamischen Erzeugung von HTML und XML Ausgaben eines Webservers dient. Sie erlaubt, Java Code und… …   Deutsch Wikipedia

  • JSP — JavaServer Pages, abgekürzt JSP, ist eine von Sun Microsystems entwickelte auf JHTML basierende Technik, die im Wesentlichen zur einfachen dynamischen Erzeugung von HTML und XML Ausgaben eines Webservers dient. Sie erlaubt, Java Code und… …   Deutsch Wikipedia

  • JSPX — JavaServer Pages, abgekürzt JSP, ist eine von Sun Microsystems entwickelte auf JHTML basierende Technik, die im Wesentlichen zur einfachen dynamischen Erzeugung von HTML und XML Ausgaben eines Webservers dient. Sie erlaubt, Java Code und… …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”