Server-side redirects: .htaccess versus Meta Redirects
URL redirects are needed for a number of reasons. One example is when you have changed significant portions of your website, and then have to deal with the problem of people finding their way from the old pages to the new pages. There are different ways of redirecting pages, through Meta tag http-equiv, JavaScript or any of the server-side languages. And what’s more, you can do it through .htaccess, which is probably the most effective, considering the minimal amount of work required to do it.
Server-side redirects: .htaccess versus Meta Redirects - How .htaccess can help you: Custom Error Pages (Page 2 of 6 )
Here are some common uses of the .htaccess file. These will allow you to have your own personal error pages (for example when a file is not found) instead of using your host’s error pages or having no page. This will make your site seem much more professional in the unlikely event of an error.
It will also allow you to create scripts to notify you if there’s an error. For example, you can create a JSP script on your own website to automatically e-mail you when a page is not found.
You can use custom error pages for any error as long as you know its number (like 404 for page not found, 403 for forbidden and 500 for server internal error) by adding the following to your .htaccess file:
ErrorDocument errorNumber /path/file.html
For example, if I had the file not_found.html in the /errors directory of my site and I wanted to use it for a 404 error I would use:
ErrorDocument 404 /errors/not_found.html
Another example is if I had made a JSP script that will automatically send me an e-mail notification when a server internal error has occurred on my site, and I put the script in the path: /utility/mailer.jsp, I would use:
ErrorDocument 500 /utility/mailer.jsp
Additionally, you can use an external page to customize your error. For example when you found a 404 Not Found page on Yahoo, and you wrote down the URL: http://www.yahoo.com/errors/404.html, you would modify your .htaccess file content as follows: