How to Create a Custom 404
You may have tried to reach a Web page that no longer exists and have been served a generic 404 page. This generic 404 is what a visitor receives when a page is non existent on the server when a custom 404 has not been implemented. Depending on the browser used, the generic 404 may state: “The page cannot be found or “File Not Found” when a web page has been removed or had its name changed.
A custom 404 is a professional and informative page designed to help visitors locate information on a Web site in place of the generic 404. In addition, Google’s Webmaster Help Center recommends the use of custom 404 pages to help visitors find the information they are looking for. The following are based on Google’s guidelines with recommendations for the following considerations when creating a custom 404:
- Create the custom 404 with the same design as the rest of the Web site.
- Use a statement to inform your visitors that the page they are seeking cannot be found.
- Include links to popular web pages, articles or posts and provide a link to the home page.
- Consider adding contact information for visitors to inform the webmaster of the missing page.
- Be certain that the HTTP headers of the custom 404 return status code of 404. This is essential for Google Sitemaps. If the web server does not return the HTTP status code of 404, the sitemap.xml will be rejected through Google’s Webmaster Tools. To test the HTTP header, use an online header checker like: Check Server Headers Tool – HTTP Status Codes Checker
How do you create a search engine friendly custom 404?
Apache Web Servers
Create the custom 404 page and then edit the .htaccess (hypertext access) file to include the following line:
ErrorDocument 404 /errorpage.html
You may name the custom 404 any name you would like (errorpage.html, 404.html, etc.).
Tip: You may need a FTP program that shows .htaccess files on the server such as Smart FTP. Upload the htacess.txt file to the server and then change the file name to: .htaccess
Upload your custom 404 page and test. For example, enter your url with a non existent file such as: http://www.yourwebsite.com/testing123. The custom 404 should be server.
Windows IIS Web Servers
ASP Custom 404
Create a custom 404 ASP file. For example: errorpage.asp
Add the following line to the top of the file before anything else:
<%
Response.Status = “404 Not Found”
%>
The above code will ensure that the HTTP status code will return a 404.
Custom 404s on Windows servers may be approached in several ways. Some web hosts must be contacted by the Web site owner to set the 404 error doc to the specific 404. Other Windows web hosting companies allow the customer to set their own custom 404 file through a control panel. Contact your web host to determine how to set the custom 404.
ColdFusion Custom 404
For ColdFusion, add the following line to the top of the custom 404 page:
![]()
After you have uploaded the custom 404 (either ASP or ColdFusion file) and have the server set to the custom 404, check the page by using a HTTP status code tool.
Custom 404 pages may be professionally designed pages offering important information to Web site visitors to replace default 404 pages. With a similar design to the rest of the site and proper coding, a custom 404 provides a search engine friendly and Google friendly page to enhance your visitor’s experience when they reach a web page that has been removed from your Web site.
© R & R Web Design LLC – a Michigan web design company that serves Michigan, Chicago, Illinois and beyond providing custom web design solutions including search engine optimization and Web site maintenance.
Tags: Apache, custom 404, custom error page, custom page not found, how to create a custom 404, search engine friendly 404, Windows server 404