Saturday, March 14, 2009

How to redirect a 404 error page

Usually when you type a wrong address for a website, you will get a 'so called' 404 page. Actually 404 is an error code given by the web server when a requested page was not found. Now, if you are a web developer or an administrator for a domain, you may want to redirect the users to the main page (let's say index.html)
All you have to do is to add this rule in your .htaccess file:

ErrorDocument 404 /index.html

Enjoy :)

No comments:

Post a Comment