Troubleshooting

Fix 404 Not Found errors on cPanel hosting

Find why pages return 404 Not Found on a cPanel site: wrong document root, case-sensitive file names, missing rewrite rules, moved pages, and custom error pages.

BeginnercPanel hosting2 min read

A 404 Not Found means the server looked for the requested file and could not find it. On a single page it is often a typo or a moved page; on a whole site it usually points to the wrong folder or missing rewrite rules. This guide helps you find which one and fix it.

Before you start

  • Copy the exact URL that fails, including capital letters.
  • Check whether only inner pages fail (home page works) or everything fails.

The whole site shows 404

  • Files in the wrong folder: open cPanel → Domains → Domains and check the domain's Document Root. Your files must be directly inside it, not in a subfolder created by extracting a ZIP (for example public_html/mysite/index.php instead of public_html/index.php).
  • DNS points elsewhere: if the 404 page does not look like your server's, the domain may still point to the old host. Check with the WHOIS checker and your DNS records.

Inner pages show 404, home page works

This is the classic "pretty URLs" problem for CMSs like WordPress, Laravel or Joomla. They rely on .htaccess rewrite rules.

  1. In File Manager enable Settings → Show Hidden Files and check that .htaccess exists in the site root.
  2. For WordPress, go to Settings → Permalinks and click Save Changes to rebuild it. See fix WordPress permalink 404s.
  3. For Laravel, the domain's document root must point to the public folder, which contains its own .htaccess.

Single files show 404

  • Case sensitivity: Linux servers treat Logo.PNG and logo.png as different files. Match the name exactly.
  • Moved or renamed pages: add a 301 redirect from the old URL to the new one so visitors and search engines follow.
  • Deleted by mistake: restore the file from JetBackup.

Find all broken URLs

  • Awstats → HTTP Status codes → 404 lists the most requested missing URLs.
  • Metrics → Errors shows File does not exist: /home/user/public_html/... lines with the exact path the server looked for.
  • Google Search Console lists 404s that Google found.

Many 404s for files like wp-login.php or .env on a non-WordPress site are just bots scanning. They are harmless; block persistent ones with IP Blocker.

Create a custom 404 page

  1. Open cPanel → Advanced → Error Pages.
  2. Choose the domain and click 404 (Not Found).
  3. Write the HTML for a friendly page with a search box or links to your main sections. You can insert tags such as the requested URL.
  4. Click Save. cPanel creates 404.shtml in the document root.

Note: CMSs like WordPress show their own theme's 404 page and ignore the cPanel error page for URLs they handle.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.