Google

Configuring Apache Redirects on 404 errors Home


Configuring Apache Redirects on 404 errors
07/02/2006 posted by Kevin S
So you want to make those annoying 404 errors go away when someone accesses your site at a URL that doesn't exist ?

Simply edit the httpd.conf file on the apache web server ( or whatever the config file might be called - this may vary for linux distributions )

Add the line ( change your target URL as required ). A local url may also be used instead.
    ErrorDocument 404 http://www.toolazy.me.uk/index.php
				
or
    ErrorDocument 404 /index.php
				
This will make any unresolvable URLs directed at your site automatically forward to the new URL.

By changing the error code, you can redirect as required.