If you encounter a404 error message either component not found or page not found on your site there are different ways to handle the situation. You can either show your users a customized 404 error message, redirect the users to another page on your site, redirect your users to another page on another site, fix the extension/component causing the 404 error message, or of course you could just leave it as it is. Since there are many reasons why a 404 error message can show up and you cannot possibly cover them all, most people generally will either try to redirect the users back to the homepage without showing an error message or display a customized error message. Below is a simple solution to how you can redirect all 404 error pages to the homepage:
1. Go to your! fileserver or ftpserver
2. Edit the file .
3. Add the following line to the file
ErrorDocument 404 index.php
4. Save and refresh your site.
That’s it! Now users won’t see an error message or be stuck on any 404 error pages. They will be immediately forwarded to your homepage.