If you are running a html website or your website is build on php and not using any CMS like wordpress or any framework like codeigniter then what you have to do is redirect your users when they visit a non existing web page on your website.
Let’s say your website do not have page http://www.yourwebstei.com/nopage.html and you want when user come to this url he redirects to index.php or any page you created for this error, let’s call that page 404.php which you have created in your root and can be visited like http://yoursite.com/404.php.
ErrorDocument 404 /404.php
The above code will redirect your user from non existing page to 404.php page, and this is search engine friendly redirection. Remember browser call this 404 error page not found. And we can handle that this way.
We are sorry that this post was not useful for you!
Let us improve this post!
Tell us how we can improve this post?