What brought me to this error page?
A 404 response simply means the requested file could not be located. If you have already uploaded it, double-check that the filename is spelled correctly and that it sits in the right folder.
Other Possible Causes
Images can also trigger a 404 when Hot Link Protection is enabled and the requesting domain has not been added to the list of authorized domains.
Seeing this error at your temporary URL (http://ip/~username/) often points to a problem with the rule set inside an .htaccess file. Try renaming that file to .htaccess-backup, then reload the site to see whether the issue clears up.
Another possibility is that the document root was accidentally deleted, or that your account needs to be recreated. In either case, reach out to your web host right away.
Running WordPress? Jump to the section below on 404 errors that appear after clicking a link in WordPress.
Checking the spelling and folder location
Missing or Broken Files
Whenever a 404 appears, start by reviewing the URL you are trying to open in your browser. That URL is what tells the server which resource it should try to fetch.
http://example.com/example/Example/help.html
In this example, the file needs to live in public_html/example/Example/
Keep in mind that CaSe matters here. On platforms 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 those names are case-sensitive.
Missing Image
If an image is missing from your site, you may 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 could not be located.
This differs from browser to 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
In this example, the image file needs to be in public_html/cgi-sys/images/
Again, CaSe matters here. On platforms that enforce case-sensitivity, PNG and png are treated as different locations.
WordPress 404s When Following Links
In WordPress, 404 Page Not Found errors commonly show up after a new theme is activated or after 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: Reset the Permalinks
- Log in to WordPress.
- 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.)
- Select Default.
- Click Save Settings.
- Change the settings back to the previous configuration (before you selected Default). Put the custom structure back if you had one.
- Click Save Settings.
This resets the permalinks and resolves the problem in many cases. If it does not, you may need to edit the .htaccess file directly.
Option 2: Edit the .htaccess File
Insert the following code snippet 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 in its links, redirects to another site, or loses its images and styling, these symptoms usually share one cause: the wrong domain name is configured in your WordPress blog.
Editing your .htaccess file
The .htaccess file holds directives (instructions) that tell the server how to act in certain situations, and they directly shape how your website behaves.
Redirects and URL rewriting are two of the most common directives in a .htaccess file, and scripts such as WordPress, Drupal, Joomla and Magento add their own directives so they can operate.
At some point you may need to edit the .htaccess file for a variety of reasons. This section explains how to edit it in cPanel, though not what should be changed (you may need to consult other articles and resources for that).
Several 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.
Editing .htaccess files with cPanel's File Manager
Before making any changes, back up your website so you can restore a previous version if something goes wrong.
Launching the File Manager
- Log into cPanel.
- In the Files section, click on the File Manager icon.
- Check the box for Document Root for and select the domain name you wish to access from the drop-down menu.
- Make sure Show Hidden Files (dotfiles)" is checked.
- Click Go. The File Manager will open in a new tab or window.
- Look for the .htaccess file in the list of files. You may need to scroll to find it.
Editing the .htaccess File
- 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.
- A dialogue box may appear asking you about encoding. Just click Edit to continue. The editor will open in a new window.
- Edit the file as needed.
- Click Save Changes in the upper right hand corner when done. The changes will be saved.
- 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.
- Once complete, you can click Close to close the File Manager window.