Error Case - 404 Page Not Found

A 404 error is an HTTP status code that means that the webpage you are trying to reach could not be found on the server. Technically, a 404 Error indicates that the page you are trying to access does not exist, maybe because it is named differently, or has been moved.

List of possible causes

Missing Index File

If the error you receive is on your main page, directly on your domain name, it means it cannot find the index file. The index (main page or homepage) must be called 'index'. If your home page is called home.html, you should consider renaming it to index.html. The extension can be .html, .php without a problem, depending on your programming language. If you do not want to modify the home page's name, here is what you can do...

Changing Directory Index

You can specify to the browser that looks up your site that it should look for another name than index.html, per example. Here is how:

  • Log into the server through FTP (or use the cPanel File Manager)

  • Locate the .htaccess in the /public_html/ directory

  • Edit this file and enter the following line (the file name may be different).
    DirectoryIndex default.php

  • Save and you are done!

Mislocation

The file you are trying to reach is the wrong folder. Oftentimes people will upload their site and data in the home directory. For these files to be accessible, they need to be located in the /public_html/ folder.

Syntax

The page you are trying to reach may be spelled differently. Since our servers are linux-based, syntax is considered in its entirety. This means that FILENAME.html and filename.html are different files for the server's interpretation.

Absent file

Maybe the file/folder you are trying to locate is just absent. Your only solution is to upload the missing data at the correct location.

Redirections

It is finally possible that you have a redirection setup that looks up the file in another directory. Diagnostic of this situation is easier than you think: look at your URL. Did it change from what you requested? If not, redirection is probably not your cause. If so, look for any redirections in your .htaccess file(s) that would have the URL change to another destination.

Those are all the cases you can encounter for the 404 Not Found error.

0 Comments

Please sign in to leave a comment.