I am simply tryng to redirect the 404 page to my custom 404 page...using Hostgater. Here is my .htaccess file (you will notice the last line is the code in question)...I just cant seem to get it to work... # $Id: .htaccess,v 1.2 2003/09/24 13:57:00 wilt Exp $ # # This is used with Apache WebServers # # For this to work, you must include the parameter 'Options' to # the AllowOverride configuration # # Example: # # <Directory "/usr/local/apache/htdocs"> # AllowOverride Options # </Directory> # # 'All' will also work. (This configuration is in the # apache/conf/httpd.conf file) # The following makes adjustments to the SSL protocol for Internet # Explorer browsers <IfModule mod_setenvif.c> <IfDefine SSL> SetEnvIf User-Agent ".*MSIE.*" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 </IfDefine> </IfModule> # PHP configuration values <IfModule mod_php5.c> php_flag register_long_arrays On php_flag register_globals On php_flag display_errors Off </IfModule> <IfModule mod_php4.c> php_value session.use_trans_sid 0 php_value register_globals 1 php_flag display_errors On php_flag track_errors Off </IfModule> Errordocument 404 /404.html Now...here's the code for the 404.html page (which seems to work fine)...i just cant get the .htaccess to redirect to the 404.html page. <html> <head> <script type="text/javascript"> <!-- window.location = "http://www.mywebsite.com" //--> </script> </head> <body> </body> </html>
Try placing the code at the top, and make sure your html file is in the same directory as the access file and matches the name correctly. Cheers,