Mini Howto: 404 error pages using htaccess

Instead of the default 404, you can customize this page to regain some lost traffic.

In your domain’s root directory where your main index page is, add this line to the top of your .htaccess file:

ErrorDocument 404 /index.html

Instead of index.html, use whatever you have named your index page.  Many options are available here.  You can create a page, named for example, 404.html.  Then, you could populate that page with links or other information for your users.  Then, use that page in the htaccess directive above.

What is htaccess?  It is a file of directives for apache to process for your particular site.  The file is actually named .htaccess (the dot in front prevents users from reading your htaccess file directives and content via a web browser.

keywords: 404 custom error pages redirect file not found htaccess