Web Developer Tools

404 File not Found

We’ve all seen the 404 page as we’ve surfed the web and it makes us sad, “404: Page not Found.” Usually it happens when a page on a site we are visiting has been moved or removed. Often as a user we just leave the site. It’s a missed opportunity for the visitor and the web owner. I have two fixes.

As a visitor, a good re-route is to access the web site’s home page and look for a site map or search tool to search for whatever it is you need. To get to the homepage you want to strip down the web address to its root or http://www.domainname.com. For example if you visit http://www.treacyinfo.com/byte.htm you will get to my “digested bytes” page. Strip that down to http://www.treacyinfo.com and you’ll get to my homepage. Some pages may not use the “www” – so another way to look at it is to delete anything after the third /.

As a web owner, consider adding a customized 404 page. Then when visitors try to access a page on your site that doesn’t exist they will get a more helpful message than “file not found.” The first step is to create the page; include a message such as “sorry this page does not exist” and then point the visitor to your site map, search tool, and/or provide contact information. Second, you want to have your server point to that page whenever a user tries to access a page (file) that does not exist in your domain. To do this, create an .htaccess file. Start by creating a text file in Notepad; it should contain the following:

ErrorDocument 404 /notfound.htm

where “notfound.htm” is the name of the custom page you just created. Save the document as htaccess.txt. Once it is saved you will want to change the name to .htaccess and upload it (and your new custom page) to your server.

This won’t work with all servers – but it has worked with most that I have tried. Some web hosts (such as Go Daddy) make it even easier. On their administrative pages they let you flag options for 404 errors: use their custom page (which advertises their services); point users to your homepage; or create your own.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s