I know this has been discussed before..but I just can't seem to get it to work correctly. Simply trying to re-direct all 404 pages to my index.php. I am using cpanel with hostgator: Linux CentOS I have the followng line of code in my .htaccess file (last line): ErrorDocument 404 index.php I also tried: ErrorDocument 404 http://www.mywebsite.com and ErrorDocument 404 http://www.mywebsite.com/index.php Well, nothing happens when you hit a 404 page...still get all those ads from hostgator and no re-direct. Any help would be highly appreciated. Thanks.
You could try this instead at the end of your .htaccess: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*) index.html Code (markup):
This is what I do with my sites on hostgator for 404 pages. Put this line in my .htaccess file: Errordocument 404 /404.html Code (markup): Then created a file called 404.html with this code: <html> <head> <script type="text/javascript"> <!-- window.location = "http://www.mywebsite.com" //--> </script> </head> <body> </body> </html> Code (markup): Best of luck