A 404 'Page Not Found' error appears when a visitor (or you) tries to access a URL that does not exist on your server. Here is how to fix it.
Fix 1: WordPress Permalink Issue (Most Common for WordPress Sites)
This is the most frequent cause of 404 errors on WordPress sites — especially after a migration or server change.
- Log in to your WordPress admin (yourdomain.com/wp-admin).
- Click Settings > Permalinks.
- Click Save Changes (without changing anything).
- WordPress will regenerate your .htaccess file with the correct rewrite rules.
- Test the URL that was giving the 404 error.
Fix 2: The File Does Not Exist on the Server
If the URL points to a specific file that used to exist (e.g., yourdomain.com/portfolio/project1.html):
- Log in to cPanel File Manager.
- Navigate to public_html and look for the file.
- If the file is missing, re-upload it or update the link to point to the correct URL.
Fix 3: Broken Internal Links
If your WordPress site has internal links pointing to pages that were deleted or renamed:
- Install the Broken Link Checker plugin (free) — it scans your site and lists all broken links
- Update or remove the broken links from your content
- Set up 301 redirects for any old URLs that have changed to new ones (see .htaccess redirect in WH-12)
Fix 4: .htaccess File Missing or Corrupted
- In cPanel File Manager, check that .htaccess exists in public_html (enable Show Hidden Files).
- If it is missing, create a new file named .htaccess in public_html.
- For WordPress, paste in the default WordPress .htaccess content:
# 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
Creating a Custom 404 Page
A custom 404 page improves user experience by helping visitors find what they were looking for instead of showing a generic error.
- In WordPress: install the 404page plugin or configure a custom 404 page in your theme settings
- In cPanel: go to Error Pages, select 404, and design a custom HTML message
