Fixing 404 (Not Found) Error in cPanel — Possible Causes & Solutions
Verify DNS Configuration
If your domain is not resolving correctly, it could cause a 404 error.
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
- Log into cPanel
- Go to Zone Editor > Manage
- 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:
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:
- Go to File Manager
- Navigate to
public_html/ - 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.
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
- Open File Manager in cPanel
- Locate
.htaccessinpublic_html/ - Rename it temporarily:
mv .htaccess .htaccess_backup - 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!


