Current Date and Time:
Thu Mar 11th, 2010 10:21 am
htaccess Tutorial
using .htaccess to display a Custom 404 Error Message. There's a quick and easy way to use .htaccess to display a Custom 404 Error page
Problem - Your server displays the standard "Page Not Found" 404 set by your webhost.
Solution
Using your .htaccess file you can set the document that you want to display. It can be a regular html file or it can even be a custom program if you like.
Requirements - Apache Server. IIS may require a separate module.
There are a number of uses for a custom solution like this. The regular 404 message is quite standard and probably doesn't tell the user much. You may be better served giving the user a choice of links or a search box function so that they can stay within your website. You may not have a second chance to service that end user again.
Depending on the level of tracking built-in to your website, you may want to redirect the user. Be careful of re-directs as they affect spiders though. They may have trouble indexing your site if all the 404's point to the root domain.
Tip - you may need to make this file "world readable". Use SSH and chmod 644.
Additional Reading
htaccess tutorial - Document details many of the best uses of .htaccess for customizing your website.