The 404 page not found error is a common issue that happens on most websites. Once this error appears, it means that the browsers of your visitors already send the requests to the given servers, but the servers cannot find what are requested.
Your readers can see nothing from your site but an error message indicating that there is a 404 error.
Frankly speaking, this is irritating for people looking to see something on your site. And for you, this may cause the loss of traffic greatly.
So we created this beginners guide to 404 errors, telling you how to fix this page not found problem effectively.
What is 404 Error?
The 404 error is what a webpage returns after a user tries to open a webpage that does not exist. The visitor may have mistyped the webpage URL or the webpage might have been moved completely. It may also be caused by your pages having an incorrect linking either internally or externally.
When some of the resources are removed from your web server, it may result in a 404 error too. You changed the link of your content, and thus the previous link was rendered useless and cannot be located online.
Another thing that causes the 404 error is when a crawler from a search engine tries to find a generic page that you do not have on your site. Note that having too many 404 errors from your site is lethal for your site traffic.
Note that there are many ways for you to recognize the 404 error. After all, the 404 page not found message can be customized by the site owners, but the common error messages look like as below.
- 404 error
- 404 page not found
- Error 404
- HTTP 404
- The requested URL was not found on this web server
- 404 file and directory was not found
Common Reasons for 404 Errors & Useful Troubleshooting
Generally, the 404 error can happen when your readers type the wrong page link and when you remove or delete the existing URL without the redirection. In this case, to fix this error, the following methods can be tried.
- Refresh the page or load the page address once again.
- Make sure that the link is 100% correct.
- Clear the cache and cookies especially when you have dealt with this issue.
- Scan for malware as some malware files will force this error on your website.
- Make sure that the SSL certificate is set up properly if a 404 error happens after the installation of the SSL certificate.
- Check whether you have reached the memory limit. If so, you should enlarge the limit.
- If your website is WordPress based, you should regenerate the .htaccess file by going to Settings > Permalinks section of the admin panel and clicking the Save Changes button.
Create an Error 404 Custom Page
It is easy to create an error 404 page and have your site traffic intact. However, you need to communicate to your web hosting site to change some settings. Here’s how you are going to do.
It is easy to create your 404 error page through your cPanel. Sign into your cPanel and click File Manager button under Files tab. You can be presented with options as the image showed as below.
Select Web Root (public_html/www) and then select the Go button. After this first step, you can now create your file. Visit the menu on your left hand at the top and select New File. Name the file as 404.html and click Create New File. After this, edit the file by right clicking on it.
After selecting to edit the file, enter the code below to set your 404 error page.
Save changes and try out your newly created page.
Transfer the HTML Page to Your Website
You now need to upload the file to your website. You can do this through FTP or the use of a file manager. Upload the created page to your web server. Ensure that the page has been uploaded right by visiting https://www.yoursite.com/404.html
Setting Up Your Server on Apache
For WordPress sites, the configuration of your server requires you to edit .htaccess file. You can seek help from your web host provider who can offer the information on the configuration of the server and any other details you may need.
If you have access to the .htaccess file, you need to add the code of “ErrorDocument 404 /404.html” to the text in it after connecting to your blog site through FTP. You can alternatively create the file. After this, save the file and later upload it into your site.
You can then test the page by visiting https://www.yoursite/asdf. If the page is good, then you are done with this as simple as that.
What Should Not Do While Setting a Custom 404 Error Page
You are advised not to direct your visitors to your homepage as they are in need of different content from your site. Besides, you should not direct the visitors to another website as this can irritate them more and lead no benefits to you.
You should also not use this opportunity to direct members to your registration page or a Flash page. If your site has been experiencing the 404 error page for long, it is time to create a 404 custom page and get the necessary traffic to your site.
So, what content should you put into the custom 404 error page? This actually depends on what kind of website you are running and what goal you bear in mind. For instance, if you are working a blog site and do not want to overload your readers with too much relevant content, you can display a search box, a list of your recent posts or your contact form.
How Do You Know Which Pages Are Producing Errors?
As a good webmaster, you should be able to check the pages that have the errors within your site. You may check the statistics and see whether a number of visitors have been trying to reach your pages but only find they are not available. If a high number of visits are from a single page, then you can redirect your visitors to that page when a 404 error happens.
It is easy to know which pages that are producing 404 error on your site by visiting the Awstats on the cPanel of your site. In this way, you are able to see the number of errors within a given duration and to which pages the errors come from.