How To Set 404 Page Not Found Using .htaccess File in cPanel For Linux Website
404 Page Not Found Error page will allow you to set the message that visitors to your site receive when they request a page that doesn't exist on the server. The easiest way to modify your .htaccess file would be using cPanel's file manager with the instructions below.
This short tutorial will guide you on how to set up a 404 page not found error page via .htaccess file using Cpanel for a Linux website.
Step 1: Login to your Cpanel.
Step 2: Go to → File Manager
Step 3: Under public_html → Select .htaccess file → Right click on the file and select Edit.
Step 4: Copy paste the below code in the .htaccess file and click on Save Changes.
ErrorDocument 404 "<H1>Page not found</H1>"
Step 5: If you already have a static HTML page that you'd like to use for 404 errors. Then, copy paste the below code to directly point to that file via .htaccess.
ErrorDocument 404 /404page.html
Step 6: You have now successfully created the 404 page not found error page for your linux website.