Arsal • Location • Starter

How to Fix "404 Not Found Error" on WordPress Posts and Pages in cPanel

Client Problem: The website homepage loads correctly, but opening any inner pages or posts results in a "404 Not Found" error.

Cause: The .htaccess file is missing, corrupted, or lacks the standard WordPress rewrite rules needed for custom permalinks.

Technical Solution Steps:

  1. Log in to cPanel: Access your cPanel account using your login credentials.

  2. Access File Manager: Navigate to Files > File Manager and open the public_html directory (or your domain's root folder).


  3. Show Hidden Files:

    Note: if .htaccess is not visible then..
    Click Settings in the top-right corner, check Show Hidden Files (dotfiles), and click Save.



  4. Recreate .htaccess File: If .htaccess exists, rename it to .htaccess_old. If missing, click + File, name it .htaccess, and add the default WordPress rewrite rules:

    Apache
    # 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
    
  5. Reset Permalinks in WordPress: Log in to your WordPress dashboard, go to Settings > Permalinks, and click Save Changes without changing anything to refresh rewrite rules.