Error 404 – We Couldn't Find That Page

What brought me to this page?

A 404 response signals that the requested file cannot be located. If you have already uploaded it, the filename may be typed incorrectly or the file may sit in another directory.

Other Possible Causes

Images can also return a 404 when Hot Link Protection is enabled and the referring domain has not been added to the list of permitted domains.

Should you visit your temporary URL (http://ip/~username/) and encounter this error, the rule set inside an .htaccess file may be at fault. Try renaming that file to .htaccess-backup, then reload the site to see whether the problem clears.

Another possibility is that your document root was deleted by accident, or your account needs to be rebuilt. In either case, reach out to your web host right away.

Running WordPress? Take a look at the section below covering 404 errors that appear after clicking a link in WordPress.

Checking the spelling and folder path

Missing or Broken Files

Whenever a 404 appears, double-check the URL you entered in your browser. That address is what tells the server which resource it should try to fetch.

http://example.com/example/Example/help.html

For this example, the file needs to reside in public_html/example/Example/

Keep in mind that CaSe matters here. On systems that enforce case-sensitivity, example and Example point to different locations.

With addon domains, the file belongs in public_html/addondomain.com/example/Example/, and the names are case-sensitive.

Broken Image

If an image is missing from your site, you may notice a box containing a red X in its place. Right-click that X and select Properties; the details will reveal the path and filename that could not be located.

This differs from browser to browser. If no box with a red X appears, right-click the page, choose View Page Info, and open the Media tab.

http://example.com/cgi-sys/images/banner.PNG

Here, the image file needs to be located in public_html/cgi-sys/images/

Again, CaSe matters in this example. On systems that enforce case-sensitivity, PNG and png are treated as different locations.

WordPress 404s That Appear After Clicking a Link

In WordPress, 404 Page Not Found errors frequently show up after a new theme is activated or when the rewrite rules in the .htaccess file have been changed.

If a 404 error appears in WordPress, you have two ways to fix it.

Option 1: Correct the Permalinks

  1. Log in to WordPress.
  2. From the left-hand navigation menu in WordPress, click Settings > Permalinks (Note the current setting. If you are using a custom structure, copy or save the custom structure somewhere.)
  3. Select  Default.
  4. Click Save Settings.
  5. Change the settings back to the previous configuration (before you selected Default). Put the custom structure back if you had one.
  6. Click Save Settings.

Doing this resets the permalinks and resolves the problem in many cases. Should it not work, you may need to edit your .htaccess file by hand.

Option 2: Modify the .htaccess File

Insert the code snippet below at the top of your .htaccess file:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# End WordPress

If your blog displays the wrong domain name in links, sends visitors to another site, or loses its images and styling, these symptoms usually share one cause: an incorrect domain name configured in your WordPress blog.

Editing your .htaccess file

An .htaccess file holds directives (instructions) that tell the server how to act in particular situations, and these directly shape how your website behaves.

Redirects and URL rewriting are two of the most common directives in an .htaccess file, and scripts such as WordPress, Drupal, Joomla and Magento add their own directives so they can operate.

At some point, and for a variety of reasons, you may need to edit the .htaccess file. This section explains how to edit it in cPanel, though not which changes to make (you may need to consult other articles and resources for that).

There are Many Ways to Edit a .htaccess File

  • Edit the file on your computer and upload it to the server via FTP
  • Use an FTP program's Edit Mode
  • Use SSH and a text editor
  • Use the File Manager in cPanel

For most people, the simplest route to editing a .htaccess file is the File Manager in cPanel.

How to Edit .htaccess files in cPanel's File Manager

Before making any changes, it's a good idea to back up your website so you can restore an earlier version if something goes wrong.

Open the File Manager

  1. Log into cPanel.
  2. In the Files section, click on the File Manager icon.
  3. Check the box for Document Root for and select the domain name you wish to access from the drop-down menu.
  4. Make sure Show Hidden Files (dotfiles)" is checked.
  5. Click Go. The File Manager will open in a new tab or window.
  6. Look for the .htaccess file in the list of files. You may need to scroll to find it.

To Edit the .htaccess File

  1. Right click on the .htaccess file and click Code Edit from the menu. Alternatively, you can click on the icon for the .htaccess file and then click on the Code Editor icon at the top of the page.
  2. A dialogue box may appear asking you about encoding. Just click Edit to continue. The editor will open in a new window.
  3. Edit the file as needed.
  4. Click Save Changes in the upper right hand corner when done. The changes will be saved.
  5. Test your website to make sure your changes were successfully saved. If not, correct the error or revert back to the previous version until your site works again.
  6. Once complete, you can click Close to close the File Manager window.