Everytime when someone types in a wrong url, (eg. they typed in a url with .htm when the url is acutally .html, or they misspelt something), they'll be sent to a 404 error page. How do I create a customized 404 page? Just like marketingtips website.
Most webhosts allow you to create custom error pages. I would check out your webhost FAQ. My webhost has a link on the control panel with step by step instructions on how to do this. Rick Lane
Assuming Apache is your web server, in httpd.conf or in an .htaccess file, set ErrorDocument 404 /path/my404.html Code (markup): where my404.html is a regular html document that says what you want your 404 error doc to say. My personal site has this 404 page; <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="generator" content= "HTML Tidy for Linux/x86 (vers 12 April 2005), see www.w3.org" /> <title>404 Error | Gary Turner | web development sandbox</title> <style type="text/css"> /*<![CDATA[*/ html, body { height: 100%; margin: 0; padding: 0; } body { font: 100% verdana, helvetica, sans-serif; background-color: #f8f8f8; color: #222; } p { font-size: 1em; } h1 { font: 1.5em georgia, geneva, serif; text-align: center; } #wrapper { display: table; height: 100%; width: 100%; } #cell { display: table-cell; vertical-align: middle; } #inner { position: relative; margin: 0 auto; border: 2px solid black; -moz-border-radius: 16px; padding: 0 10px; width: 75%; } #footer { text-align: right; } /*]]>*/ </style> </head> <body> <div id="wrapper"> <div id="cell"> <div id="inner"> <h1>Oops! There's been a mistake</h1> <p>This is known as a “404 file not found” error.</p> <p>Try looking at the <a href= "/webdev/">webdev index</a> page to find the file you wanted.</p> <p>--g</p> <hr /> <p id="footer">©2005-06 Gary Turner</p> </div><!-- end inner" --> </div><!-- end cell --> </div><!-- end wrapper --> </body> </html> Code (markup): cheers, gary
I've had what seems like a sudden spike in my custom 404 page being accessed. But I can't figure out what page is referring to it. (The "Referer" field on my recent visitors page is invariably blank.) Is there a way to find this out? Or is this a question for my host (hostgator)? It seems to often come from a user who only loads a single page. If I had an affiliate link messed up, or a broken image, would the 404.html page show as having been loaded?