How To Create 404 Error Page
Contents |
- sql HTML & Graphics Tutorials getting started backgrounds buttons browser specific colors forms frames html 4.01 tags html 4.01 ref image maps tables web graphics Beyond HTML asp cascading style sheets css keyword ref custom 404 page template cgi scripting developer research center dhtml/layers dot net java applets javascript javascript frameworks
Custom 404 Page Examples
javascript keyword ref javascript script tips mobile web development open source cms php security SEO vb script keyword ref webmaster tips
Custom 404 Page Apache
webmaster projects webmaster toolbox video xml general reference pieces the master list Need Help? discussion boards mentors Post a comment Email Article Print Article Share Articles Reddit Facebook Twitter del.icio.us Digg Slashdot DZone
Custom 404 Page Htaccess
StumbleUpon FriendFeed Furl Newsvine Google LinkedIn MySpace Technorati YahooBuzz How Do I Create a Custom 404 Error Page? By Joe Burns Tweet Ah, the aggravating 404 error page. You've seen it. There you are, surfing in your favorite search engine when you happen upon just the thing you're looking for. You click: (***Raspberry Sound Effect***) Nothing but a white page with the words "404 Error" and some other 404 error page html code techie-sounding speak beneath. What's even more cheesy about the error code is that it really doesn't tell you what the problem is. Basically you've been informed that the server cannot find what you want. It doesn't tell you why, how to fix it, or where to go from that point. You really don't have much choice but to hit your BACK button, call the computer a dirty name, and try again. But then you see it--a server that's set up with its own special 404 error page that politely apologizes and offers you links to e-mail site administrators and maybe a site search engine. Now that's class! So I waltzed into the office of the Webmaster at work and asked how it was done. I was stunned at how easy it is to set up. Want one of your own? Here's how. You'd Best Ask First I'm going to offer you a very basic fix to this problem, but you'd best ask your system people if they want you doing this first. Better yet, ask them if you might mess things up by doing this. Your .htaccess File This is the file that will do the trick for you. You should alread
at www.example.com Port 80" Look familiar? We've all seen that too many times while wandering the Web. And if you're like most people you just hit the back button and try another how to create 404 error page in php website. Why not make a custom 404 page that's friendly for your website visitors how to fix 404 error page and gives them a way back to more familiar (or at least not lost) territory. Note: These tips for Unix hosts, not windows custom 404 page wordpress servers. Step 1 - Create the Custom 404 page Create a file called 404.php (or whatever you want to call it) with whatever you want your visitors to see when they hit a missing page. A small http://www.htmlgoodies.com/beyond/reference/article.php/3472591/How-Do-I-Create-a-Custom-404-Error-Page.htm sitemap and / or search is a nice idea, along with letting them know the file they requested is not available. You might also be interested in checking out some tips for a useful 404 error page. Step 2 - Create the .htaccess To begin open up your .htaccess file if you already have one, if not pop open notepad or your favorite text editor (No, a WYSIWYG editor won't work here) and add this http://www.webweaver.nu/html-tips/custom-404.shtml line: ErrorDocument 404 /404.php You can name your error file whatever you'd like and use whatever extension you are most comfortable with however DO NOT use an absolute (full url including the domain name) here since that makes it turn into a 200 (OK) on most setups. Step 3 - Upload Make sure your FTP program is set to upload as ASCII, upload the 404.php, then the .htaccess. Step 4 - Check it Make sure your browser cache is clear and type in a file you know doesn't exist on your server.. something like http://www.example.com/oops. You should be seeing your new, fancy, and much more welcoming 404 page. Step 5 - Double Check it! This is important, make sure your custom 404 is actually sending a 404 header! The easiest way I've found is using the Firefox extension called Live Http Headers. It shows the entire conversation between your browser and the website's server. Again, type in a file you know doesn't exist on your page, it should say 404 Not Found, not 200 OK. (If you have images on your 404 page, those will show code 200 which is exactly what you want because.. well they are there ;), so scroll to the top of the header testers output and read carefully. The page itself should send a 404.) If it'
asks for a page that’s simply not available on your site. The reason for this is that there may be a link on your site that was wrong or the page might have been recently http://www.404errorpages.com/ removed from the site. As there is no web page to display, the web server sends a page that simply says "404 Page not found". The 404 error message is an HTTP (Hypertext Transfer Protocol) standard status code. This "Not Found" response code indicates that although the client could communicate to the server, the server could not find what was requested or it was configured not to fulfill the request. The 404 "Not Found" custom 404 error is not the same as the "Server Not Found" error which you see whenever a connection to the destination server could not be established at all. The default 404 error page as shown on Internet Explorer is given below. HTTP Status Code Whenever you visit a web page, your computer will request data from a server through HTTP. Even before the requested page is displayed in your browser, the web server will send custom 404 page the HTTP header that has the status code. The status code provides information about the status of the request. A normal web page gets the status code as 200. But we do not see this as the server proceeds to send the contents of the page. It’s only when there is an error, we see the status code 404 Not Found. Origin of Status Codes As a part of the HTTP 0.9 specifications, the World Wide Web Consortium (W3C) established HTTP status codes in 1992. Tim Berners-Lee, who invented the web and the first web browser in 1990, defined the status codes. List of Status Codes A brief overview of HTTP status codes is given below. Code Meaning Description 100 Continue Confirms the client about the arrival of the first part of the request and informs to continue with the rest of the request or ignore if the request has been fulfilled 101 Switching Protocols Informs the client about the server switching the protocols to that specified in the Upgrade message header field during the current connection. 200 OK Standard response for successful requests 201 Created Request fulfilled and new resource created 202 Accepted Request accepted, but not yet processed 203 Non-Authoritative Information Returned meta information was not the definitive set from the origin server. 204 No Content Request succeeded w