How to use .htaccess files to configure the Apache Web Server to redirect a site
A short .htaccess tidbit
The .htaccess file is plain ASCII text file which is used to configure the Apache web server at the directory level.
Creating a custom '404 file not found' error page:
Nothing is more annoying to web users than the dreaded '404 file not found' error message. Using the .htaccess file you can configure the server to display a web page of your choice when a 404 error is encountered.
For example, create a web page called 'custom404.htm' and upload it to your root directory. Then create a file called .htaccess using notepad and add the following line of code.
ErrorDocument 404 /custom404.htm
Upload the .htaccess file to your root directory.
Using your Internet browser, try loading a file such as http://yourdomain/nofile.htm, this should cause a '404 file not found' error, and the Apache web server will load your customised page.