The 404 error code is a very common error message. The 404 error indicates that a specific page you tried to access a website doesn’t exist in the server. This error message is part of the HTTP/1.1 Status Codes definitions. Whenever you try to reach a page, the web server tries to find it in the local repository of files. If the server can’t find the file, or maybe if the file has a different name, then the server is unable to open the corresponding file. So, you will see the 404 error code in the web browser.

Basically, there are similar error codes, just like 500 (Internal Server Error) and 403 (Not authorized). So, the webserver throws them for different reasons. In this article, we will explore the causes of the 404 error code, and we will show you how to fix this. This error can happen both in HTTP or HTTPS servers.

How the 404 error code looks in the browser

This is how the message is presented by default. There are methods to customize the 404 error page. Is shows the error 404 texts like in the image:

The cause of the 404 error code

Basically, the 404 error indicates that a file doesn’t exist in the web server. There are other causes like .htaccess configurations or wrong redirects that may apply. In this article, we will explore and explain the most common cause, which is a non-existent file.

For example, we will show a case of a user trying to access http://www.mysamplewebsite.com/filename.htm . In this request, the web server tries to find filename.htm in the local disk. By default, you must store the files inside the public_html folder using FTP. As the file filename.htm doesn’t exist, the server shows the text of the 404 error code to the user.

How do I fix the 404 error

Firstly, to fix the 404 error code you have to upload the file to the server. Make sure you place the file inside the public_html folder. In the following image, we will show the filename.htm uploaded by FTP to the server. Now, the problem is gone and the URL of our example can be accessed without this error message.

You can see in this other article the complete definition of HTTP/1.1 Status Codes

Custom 404 error page

It’s possible to have a customized 404 error page, with your own text and images. In this article, we explain in details how to have a personalized page for the 404 error.

The HTTP 404 error may also decrease your search engine rankings

It’s not uncommon, and you have probably seen the 404 error message when searching in Google. Whenever a requested page returns such error, the search engines decrease its ranking. Google and other search engines evaluate the user experience. Whenever a user searches for something, the search engine must provide the greatest answer possible.

For domains with lots of pages showing the HTTP 404 error, Google can also apply a ranking penalty. Even for the other pages. It understands that such domain delivers a bad user experience.

Broken links can also harm your Google ranking positions. Every search engine has bots, which keep crawling all the internet 24 hours a day. Whenever they find a broken external link on your website, they also decrease your domain evaluation.

Other uncommon possible causes for this error

Not only problems with the server or files can cause such error. Client-side issues can also be a possible cause. For example, infected clients with spyware or viruses can have their URL’s automatically redirected. There are also spywares that can change your hosts file, overlapping your provider’s DNS servers. This can redirect your navigation to other external sites, throwing 404 errors.

Browser caches can also cause this issue. Some older browsers used to keep caches for a long time so that users needed to clear them actively. Today’s browsers have better cache control, and this possible cause isn’t as common as it was in the past.

Another possibility is a delay in DNS propagation. Delays in DNS servers to update their records can also point your website’s IP address to a wrong or outdated web server.

Some historic 404 error memes

Having a 404 error page shown on a website isn’t the end of the world. Many companies make fun of it. We have chosen a few memes as examples:

Conclusion

Basically, the 404 error text can be fixed at the FTP site of the server. The user has to make an FTP file transfer in order to place the non-existing files in the web hosting server. Also, in some times, the user needs to rename the files to adjust the file names with the links on the website.