Error HTTP 404
There are different kinds of HTTP errors, but the most common one is a 404 error. It is displayed when the requested page does not exist. This error tells us that your browser has successfully connected to the server, but the page you are trying to open cannot be found. This means that the file no longer exists and most likely has been moved to another location, but the page owner has not changed the link. In other words, the 404 error tells us that the user's browser tried to load a file that does not exist or is not in the location where the browser looks for it on the server. Therefore, the server responds with a 404 error instead of the requested content.
It may happen that the cause of the 404 error are incorrect mod_rewrite settings in the .htaccess file, i.e. incorrect settings of the so-called friendly URLs. In this case, the 404 error is generated by mod_rewrite, which is unable to translate the given address into a real path.
The most common causes of 404 errors:
- the user tried to open this file: http://website.cba.pl/subpage/subpage1.html, even though subpage1.html is located in the root directory and could only be found at this address: http://website.cba.pl/subpage1.html. The server could not find the file due to the incorrect path and responded with a 404 error.
- the user wanted to open a web page and entered in the address bar: http://website.cba.pl/sbpage/subpage1.html, while it should be: http://website.cba.pl/subpage/subpage1.html - there is a typo in the word subpage. The server could not find the directory sbpage that does not exist and does not contain subpage1.html file, so it returned a 404 error. The same situation would happen if there was a typo in the name of the file.
- the address http://website.cba.pl/nicepage (friendly URL) must redirect the user to the file located at the correct (not so friendly) address: http://website.cba.pl/year-2016/mynicepage.html using the mod_rewrite module. But the site administrator has misconfigured this module. As a result, the server cannot 'translate' the link http://website.cba.pl/nicepage to http://website.cba.pl/year-2016/mynicepage.html, so the error 404 is displayed.
What to do to fix the 404 error:
- check if the names of the files and directories are correct.
- check that the requested file we expect to find at http://website.cba.pl/subpage/subpage1.html is actually in the directory called subpage and that the file is called subpage1.html.
- check the case sensitivity in the names of the files and directories. On the server, the subpage1.html file is different from subpage1.HTML or SUBPAGE1.html - they are three different files.
- If the mod_rewrite module is configured incorrectly, you need to check the code of the .htaccess file or, if this module is configured by a plugin, check the plugin settings.