Knowledgebase

How to fix 404 errors and create a custom 404 page in cPanel

A "404 Not Found" error means the server could not find the page that was requested. A few 404s are normal on any website, but many of them hurt visitors and SEO. This guide shows you how to find and fix 404 errors on cPanel hosting, and how to create a custom 404 page that keeps visitors on your site.

Common causes of 404 errors

  • The page was deleted or its URL (slug) changed.
  • A typo in a link, or a different letter case. On Linux servers About.html and about.html are two different files.
  • Files were uploaded to the wrong folder (for example outside public_html).
  • On WordPress, the permalink rules in .htaccess are missing, so every page except the home page shows 404.
  • After moving or redesigning a site, old URLs no longer exist.

Step 1: Check the file location

  1. Open File Manager and go to the document root of the domain (usually public_html for the main domain; addon domains have their own folder, visible in Domains).
  2. Make sure the file exists with exactly the same name and letter case as in the URL.

Step 2: Fix WordPress permalinks

If the home page works but posts and pages show 404:

  1. In WordPress go to Settings > Permalinks.
  2. Click Save Changes without changing anything. WordPress rewrites the .htaccess rules.
  3. If it still fails, check that .htaccess exists in the WordPress folder and contains the # BEGIN WordPress block.

Step 3: Redirect old URLs (301)

When a page moved permanently, redirect the old URL to the new one so visitors and Google follow it. You can use Redirects in cPanel (in the Domains section), or add a line to .htaccess:

Redirect 301 /old-page.html https://example.com/new-page/

On WordPress, a redirect plugin makes managing many redirects easier. For whole-site rules like HTTPS and www, see How to Force HTTPS and Redirect www to non-www (or non-www to www).

Step 4: Find broken links

  • In Google Search Console, the Pages report lists URLs that return "Not found (404)".
  • In cPanel, Metrics > Errors shows recent "File does not exist" entries.
  • Fix internal links in your menus and content, and add 301 redirects for important old URLs that other sites link to.

Step 5: Create a custom 404 page

A good 404 page tells visitors the page is missing and gives them a way forward: a link to the home page, a search box and your main sections.

Option A: cPanel Error Pages

  1. In cPanel, open Error Pages (in the Advanced section). If you do not see it, use option B.
  2. Choose the domain, then click 404 (Not Found).
  3. Write your page in HTML. You can insert tags such as the requested URL. Click Save.

cPanel saves the page as 404.shtml in the domain's document root.

Option B: .htaccess

Create a page such as 404.html in public_html, then add this line to .htaccess:

ErrorDocument 404 /404.html

Use a path that starts with /, not a full https:// address. A full address makes the server send a redirect instead of a real 404 status, which confuses search engines.

Option C: WordPress

WordPress shows the theme's 404.php template. Many themes and page builders let you design the 404 page from the dashboard, so you do not need the cPanel tool.

Tip: keep the 404 page simple and fast, with your logo, a short friendly message, a search box and links to the main pages. Do not redirect all 404s to the home page; search engines treat that as a "soft 404".

Frequently asked questions

Do 404 errors hurt my Google ranking?

Normal 404s for pages that really do not exist are fine. The problem is broken internal links and important old pages that lost their traffic. Redirect those with 301.

My whole site shows 404 after uploading. Why?

The files are probably in the wrong folder, or the domain points to another document root. See How to upload your website (File Manager and FTP).

Can I see which 404s happen most?

Yes. Check Google Search Console and the logs in cPanel Metrics.

Need help? Open a support ticket or message us on WhatsApp +20 127 113 3655.

  • 404 not found, custom 404 page, error pages, htaccess errordocument, broken links, wordpress permalinks

Was this answer helpful?

0 Users Found This Useful