Now, You can either configure a custom 404 error page on your server or redirect the website to the home page. In this tutorial, we will help you to create a custom 404 error page for your Apache server.
Create A Custom 404 Error Page
First of all, create a 404 file on your server. You can create this file under the document root of your application. For example, I have created a file named custom_404.html under the document root with the following content.
Next, create and edit the .htaccess file under the document root of your application and add the following content to the end of the file.
Save the file and close it. Now, access any file to your domain, which doesn’t exist on the server. You will see the custom error page instead of the default Apache error message on your web browser.