To solve this error, you can create a custom error page or redirect user to website home page. This tutorial will help you to redirect user to home page if 404 error occurred on server.
Setup 404 Redirect to Homepage
Edit .htaccess file under the document root of your Website hosted via Apache server. Add below content to the end of file. For example, you website document root is /var/www/domain.com. The the .htaccess file needs to edit at /var/www/domain.com/.htaccess. Make sure to change domain.com with your actual domain name.
Save file and close it. Now, access any file to your domain, which doesn’t exist on server. Test if webpage is redirected to the home page instead of showing 404 error page.