Era Host hosting
EraHost – Free Domain, Cheap Hosting!
Client Area
Support 24/7
Menu

Fixing 404 (Not Found) Error in cPanel — Possible Causes & Solutions

3 min read
17.01.2026

Verify DNS Configuration

If your domain is not resolving correctly, it could cause a 404 error.

Fix 404 Not Found cPanel
cPanel 404 — DNS, document root, files, permissions, .htaccess.

For closely related cPanel-stack topics, see cpsrvd — cPanel Service Daemon Guide, "The Webmaster Has Forbidden Your Access", and "421 Home Directory Not Available — Aborting".

Check DNS Records

  1. Log into cPanel
  2. Go to Zone Editor > Manage
  3. Ensure you have the correct A Record pointing to your server's IP.

To manually check DNS from the terminal:

nslookup yourdomain.com

or

dig yourdomain.com

If the IP does not match your server, update the DNS settings.

Check Propagation Status

If you recently updated your DNS, check propagation:

https://dnschecker.org/

It may take up to 24 hours to fully propagate.

Solution: If DNS is incorrect, update your nameservers or A records in your domain registrar.

Verify Website Files & Directory

A 404 error can occur if the requested file does not exist or is misplaced.

Check the Root Directory

In cPanel:

  1. Go to File Manager
  2. Navigate to public_html/
  3. Ensure your website files are inside this folder.

Ensure an index.php or index.html Exists

Your homepage file must be named index.php or index.html.

If missing, upload it to public_html/.

To check via SSH:

ls -la /home/yourusername/public_html/

If index.php or index.html is missing, upload your website files.

cPanel Hosting
Full control over your website
  • Convenient
  • Simple
  • Fast
  • Free 7-day trial
cPanel Hosting

Fix File & Folder Permissions

If permissions are incorrect, Apache/Nginx cannot serve the files.

Set Correct Permissions

sudo chmod -R 755 /home/yourusername/public_html/
sudo chmod 644 /home/yourusername/public_html/index.php

For cPanel users:

  • Folders: 755
  • Files: 644

Restart Apache:

sudo systemctl restart apache2

or for Nginx:

sudo systemctl restart nginx

Check .htaccess for Misconfiguration

  1. Open File Manager in cPanel
  2. Locate .htaccess in public_html/
  3. Rename it temporarily:
    mv .htaccess .htaccess_backup
  4. Try reloading your website.

If it works, restore .htaccess and check for misconfigured rules like:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . /index.php [L]

If .htaccess was the issue, regenerate permalinks (for WordPress sites) in:

WordPress Admin > Settings > Permalinks > Save Changes

Verify Web Server Configuration

If you have multiple domains or subdomains, check your Apache Virtual Host settings.

Check Virtual Host Configuration

For Apache:

sudo nano /etc/apache2/sites-available/000-default.conf

Ensure:

<VirtualHost *:80>
    DocumentRoot /home/yourusername/public_html
    ServerName yourdomain.com
</VirtualHost>

For Nginx:

sudo nano /etc/nginx/sites-available/default

Ensure:

server {
    root /home/yourusername/public_html;
    server_name yourdomain.com;
}

Restart your web server:

sudo systemctl restart apache2

or

sudo systemctl restart nginx

Clear Cache and Test Again

Clear Browser Cache

Press Ctrl + Shift + R or clear cache from browser settings.

Clear Server Cache (If Using Cloudflare or CDN)

  • Go to Cloudflare > Caching > Purge Everything
  • If using a caching plugin (e.g., in WordPress), clear the cache.

Summary of Fixes

Issue Fix
Incorrect DNS records Check via dig yourdomain.com and update DNS
Files missing in public_html/ Ensure files are correctly placed
Missing index.php or index.html Upload and set correct permissions (644)
Incorrect file permissions chmod -R 755 /home/yourusername/public_html/
Misconfigured .htaccess Rename .htaccess and regenerate
Virtual Host misconfiguration Check Apache/Nginx settings
Cache issues Clear browser cache & CDN cache

After following these steps, your website should load correctly!

Frequently asked questions
DNS not yet propagated to your local resolver. Browser thinks domain resolves somewhere but Apache vhost on the new server doesn't have that domain configured yet. `dig +short yourdomain.com @1.1.1.1` to confirm DNS. If it returns the new server's IP, check WHM → Domains list confirms the domain is added to the right account.
Two patterns: (1) URL rewriting issue — Apache is treating /some-path as a literal file that doesn't exist instead of letting CMS handle it. Check .htaccess RewriteRule for index.php fallback. (2) Specific files deleted/renamed without updating links. Check the URL pattern; CMS-handled URLs need RewriteRule, static files need to actually exist on disk.
Permalinks need mod_rewrite + .htaccess with the WP rewrite block. WP Settings → Permalinks → Save (regenerates .htaccess). Verify mod_rewrite is on (cPanel default yes), AllowOverride All in vhost (cPanel default yes), .htaccess is writable. Most common: AllowOverride None set somewhere blocking the RewriteRule.
ErrorDocument directive needs path relative to document root, starting with /. `ErrorDocument 404 /404.html`. Or full URL. Then verify /404.html actually exists. Some shared hosts disable custom ErrorDocument via parent config — check by adding a test directive and seeing if it takes effect.
Related articles
Fixing "Internal Server Error" (500) in Apache/Nginx
Fix "ssh_init: host not found" Error in SSH
MySQL error in file: /engine/classes/mysql.php at line 52