A PHP Redirection Script
This script is intended to be used as an apache 404 error page. When an html document is not found, it will try to find the same document with the php extension, otherwise it will redirect the user to your home page. Save this script as redirect.php and create a file called “.htaccess” in your root directory with the following line: ErrorDocument 404 /redirect.php. Any time a user requests a missing file it should redirect them appropriately.
Read more…