Custom Error Pages
Posted on | July 9, 2009 | No Comments
Why a customized error page?
It is insufficient to simply let the visitor know that the file could not be found. In order not to lose that visitor, you should provide them some way to locate the document they wanted.
However, the primary aim of custom error pages is to make sure your visitor does not leave your site if they cannot find what they were looking for. If you like, you can even put a simple form on the page to allow your visitors to inform you of the broken link.
WordPress 404
For WordPress installations, I use and recommend the Smart 404 plugin by Michael Tyson. When content cannot be found, Smart 404 will use the current URL to attempt to find matching content, and redirect to it automatically. Smart 404 also supplies template tags which provide a list of suggestions, for use on a 404.php template page if matching content can’t be immediately discovered.
Custom Error Sample HTML Code
Usually I place custom error pages on the websites that I build to help folks stay on the website that they’re at. They usually look something like this.
| <!DOCTYPE HTML PUBLIC “-//IETF//DTD HTML 2.0//EN”> <HTML><HEAD> <TITLE>404 Not Found</TITLE> <style> body, html { background: #333333; font-family: verdana; font-size: 10pt; COLOR: 333333; text-align:center; } b { font-weight: bold; } body,td,th { color: #333333; } body { background-color: #CCCCCC; } </style> </HEAD><BODY> <a href=”http://thinkquic.com” title=”ThinkQuic.com”><img src=”http://thinkquic.com/wp-content/uploads/logoii1.png” border=”0″ alt=”ThinkQuic.com” /></a><br /> <H1>Not Found</H1> The requested URL <!–#echo var=”REQUEST_URI” –> was not found on this server. <HR /> <br /> <br /> <script type=”text/javascript”> var GOOG_FIXURL_LANG = ‘en’; var GOOG_FIXURL_SITE = ‘http://thinkquic.com’ </script> <script type=”text/javascript” src=”http://linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js”> </script><br /> <br /> <br /> <script type=”text/javascript”><!– google_ad_client = “pub-4725XXXX7214XXXX”; /* 250×250, created 7/8/09 */ google_ad_slot = “6572002938″; google_ad_width = 250; google_ad_height = 250; //–> </script> <script type=”text/javascript” src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”> </script> <I><!–#echo var=”HTTP_HOST” –></I> </BODY></HTML> |
Tags: 404 > amp > background color > body background > color cccccc > custom error page > custom error pages > font weight > img src > michael tyson > request uri > sample html
Comments
Leave a Reply