Error 404 – We Couldn’t Find That Page

What brought me to this page?

A 404 response tells you the server can’t find the file you requested. If you’ve already uploaded it, the filename might be misspelled or the file could be sitting in another folder.

Other Possible Causes

Images can also return a 404 when Hot Link Protection is enabled and the referring domain isn’t included in the allowed domains list.

If you visit your temporary URL (http://ip/~username/) and hit this error, the rules in an .htaccess file may be responsible. Try renaming that file to .htaccess-backup, then reload the site to see if the problem clears up.

Your document root may also have been deleted by accident, or your account might need to be rebuilt. In either situation, reach out to your web host right away.

Running WordPress? Check the section below on 404 errors that appear after you click a link in WordPress.

Checking the spelling and folder path

Missing or Broken Files

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

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

In this example, the file needs to be 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.

For addon domains, place the file in public_html/addondomain.com/example/Example/, and remember that names are case-sensitive.

Broken Image

If an image is missing from your site, you might see a box with a red X in its place. Right-click that X and select Properties; the details will reveal the path and filename that couldn’t be found.

This depends on your browser. If no red X box 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 When You Click a Link

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

When 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.

This resets the permalinks and often solves the problem. If it doesn’t 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 a different site, or loses its images and styling, these symptoms typically 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 certain situations, and these directly influence how your website behaves.

Redirects and URL rewriting are among the most common directives in an .htaccess file, and platforms like WordPress, Drupal, Joomla and Magento add their own directives so they can operate.

At some point, for various reasons, you may need to edit the .htaccess file. This section shows how to edit it in cPanel, but 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 way to edit a .htaccess file is through the File Manager in cPanel.

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

Before making any changes, it’s wise 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.