What happens when a visitor accesses a non-existent page on your web site?
Do they get a generic 404 error that doesn't provide them with any useful information and makes them run away from your site?
You can cause all 404 errors to send the visitor to your index page with a single line in your .htaccess file:
Even better, you can send them to a custom error page with instructions specific to your site:
ErrorDocument 404 /
You can also use the ErrorDocument directive with other error codes, such as:
ErrorDocument 404 /404-not-found.html
- 401 (Unauthorized)
- 403 (Forbidden)
- 500 (Internal Server Error)
I like the custom method the best. Creating a static copy of the home page and adding the content page not found or some appropriate text. This way it still has all the navigation and looks like a part of the site so they can easily search or go to another location.
This way they will know why instead of just ending up at the main page. There is also a nice 404 script that can be added to these pages and will send you an email when someone hits a 404 on your site. Reports the page they were trying to visit so you can fix it or make a page to optimize these if you are getting a lot of them say from a dropped domain.
That's an awesome idea! Got a URL? :)
Originally Posted by Mr.Bill
Sorry was looking for it was among the million other things on the external drive.
This was a script that was done for one of my sites so it can be given free just dont resell it.
Do not use this on a proxy site unless you want your mail box flooded :)
Typically I redirect all 404's to the homepage, but I guess I need to improve that.
I redirect 404's to a special page with some text and ads :D