Summary: If some pages (all except the homepage) return a 404 error after enabling a “pretty permalinks” URL structure, the most common causes are: rewrite rules missing or corrupted in .htaccess, Apache module mod_rewrite unavailable, plugin/theme conflicts, site URL misconfigured in the database, or stale caches/CDN. This guide explains the checks and fixes you can perform from WordPress and cPanel.

Prerequisites

  • Access to the WordPress admin (wp‑admin) OR access to cPanel (File Manager) and phpMyAdmin.
  • A recent backup of files and the database. Use JetBackup or export the database via the JetBackup guide or phpMyAdmin.
  • Knowledge of your site's root folder (e.g. public_html or a subfolder).
  • If the server is managed by your host: you may need to contact support to enable mod_rewrite or modify AllowOverride.

Terms explained (once)

  • Permalinks : human‑readable URL structure (e.g. /category/post-name) provided by WordPress.
  • .htaccess : local configuration file used by Apache to apply rules (redirects, rewrites). It is located at the site's root.
  • mod_rewrite : Apache module that applies the rewrite rules contained in .htaccess .htaccess. Without it, 'pretty permalinks' do not work on Apache.

Quick steps (5‑minute test)

  1. In WordPress: Settings → Permalinks → click on Save Changes (without changing anything) to force regeneration of the rewrite rules.
  2. If that is not enough: via cPanel → File Manager, temporarily rename .htaccess (e.g. .htaccess.bak) .htaccess with the default WordPress rules (template below).
  3. Quickly disable plugins by renaming wp-content/plugins (e.g. plugins.off); if the 404s disappear, reactivate one plugin at a time to isolate the culprit.
  4. Check whether a CDN (e.g. Cloudflare) or a server cache is returning a stale 404 and purge it.

Detailed procedure (numbered actions)

1) Backup — files + database

  1. Before making any changes, export the database via phpMyAdmin or use JetBackup: JetBackup Guide and phpMyAdmin.
  2. Download an archive of the site folder (public_html or the installation folder).
File Manager button in the cPanel dashboard to access the site's files
Open File Manager from cPanel to back up or edit files (screenshot centered on the File Manager tool).

2) Reset permalinks from WordPress (if you have wp‑admin access)

  1. Log in to /wp‑admin → Settings → Permalinks.
  2. Click on Save Changes without changing anything. WordPress attempts to write the .htaccess file .htaccess automatically and regenerate the rules.

If WordPress cannot write the .htaccess file .htaccess (file permissions), it will display a message and provide the block to paste manually — see the next step.

Reference: the official permalinks help page (opens in a new tab).

Permalinks Settings — WordPress Documentation

3) Check and restore the .htaccess file

  1. In cPanel → File Manager, enable showing hidden files (files starting with a dot).
  2. Locate the .htaccess file .htaccess in the installation root (often public_html public_html).
  3. Rename it temporarily (e.g. .htaccess.bak .htaccess.bak) and test: if the 404s disappear after saving the permalinks, recreate the file with the correct content.
.htaccess file in the cPanel File Manager, ready to be edited or renamed
Locate and edit .htaccess .htaccess from the cPanel File Manager.

Default WordPress template to place in .htaccess (root):

# 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

If your site is installed in a subfolder (e.g. /blog/), /blog/adjust RewriteBase and the final rule accordingly. RewriteBase and the final rule:

# Exemple pour site dans /blog/
RewriteBase /blog/
RewriteRule . /blog/index.php [L]

After modification, check the file permissions (644 recommended) and reload the test page.

4) Test without plugins / theme (isolate a conflict)

  1. If you have access to wp-admin: deactivate all plugins, activate a default theme (Twenty Twenty-Three), then test the permalinks.
  2. If you do not have wp-admin: in cPanel → File Manager, rename the folder wp-content/plugins to plugins.off to disable all plugins instantly. Then test the URLs.
Rename the WordPress plugins folder in cPanel to temporarily disable plugins
Rename the folder plugins via File Manager to quickly disable plugins.

If the 404s disappear: restore the folder name and reactivate the plugins one by one to identify the culprit.

5) Check mod_rewrite and the server type

On an Apache server, permalinks rely on mod_rewriteIf this module is not active, the rules contained in .htaccess are ignored: 'pretty' URLs will return 404s.

  • On shared hosting, you cannot enable mod_rewrite it yourself: contact support, providing them the test URLs and a copy of .htaccess.
  • Also check that the directive AllowOverride allows the use of .htaccess (value All required in the Apache configuration).

Useful resource (opens in a new tab):

Introduction to mod_rewrite — Apache documentation

Note for Nginx: Nginx does not use .htaccess .htaccess. If your server uses Nginx or a reverse proxy, rewriting is handled in the site's configuration (server block). Common example to provide to support:

location / {
    try_files $uri $uri/ /index.php?$args;
}

6) Fix the site URL (site moved / domain changed)

  1. Open cPanel → phpMyAdmin → select the database → table wp_optionswp_options.
  2. Check the values siteurl siteurl and home home. If they point to the old address, correct them (export the SQL first).
WordPress siteurl and home entries in phpMyAdmin ready to be edited
Edit siteurl siteurl and home home in phpMyAdmin if the site address has changed.

Internal guide for phpMyAdmin: How to import / export and edit the database (phpMyAdmin).

7) Use WP Toolkit (if present in cPanel)

If your hosting provider offers WP Toolkit in cPanel, it provides integrity checks, repair actions and other utilities (reinstall core files, restore backups, etc.). It can speed up diagnosis if you don't want to make manual changes.

WP Toolkit in cPanel: check and repair a WordPress installation
WP Toolkit (if enabled): automatic integrity checks and repairs for WordPress.

Internal WP Toolkit guide: WP Toolkit (cPanel): manage your WordPress installations.

8) Clear caches and purge the CDN

Remember to clear caches on:

  • Cache plugin (WP Super Cache, W3 Total Cache, etc.)
  • Server cache (Redis, Varnish) if enabled
  • External CDN (Cloudflare or other) — purge the zone
An outdated cache can continue to return a 404 even after the issue is fixed.

9) Check redirects and custom error pages

A misconfigured redirect (in <code>.htaccess</code> .htaccess or cPanel’s Redirects tool) can cause a 404. Also check Custom Error Pages if you want to display a specific 404 page.

Useful internal guide: Configure rules and redirects via the .htaccess file and Create a custom error page.

Troubleshooting: common causes and quick checks

  • .htaccess missing or corrupted — rename and recreate the file (see step 3).
  • mod_rewrite not enabled (Apache) or the server runs Nginx — contact support.
  • A plugin or theme that alters rewrite rules — test by disabling plugins (see step 4).
  • Incorrect permissions (directories <code>755</code> 755, files <code>644</code> 644 recommended).
  • Site moved without updating <code>siteurl</code> siteurl/<code>home</code> in the database — fix via phpMyAdmin.home Site moved without updating siteurl/home in the database — fix via phpMyAdmin.
  • Cache / CDN returning a stale 404 — purge all caches.
  • Conflicting redirection rules in .htaccess .htaccess (e.g. general rules placed before the WordPress rules).

When to contact technical support

Contact technical support if, after applying the steps above, the problem persists. Provide:

  • Examples of URLs that return 404 (actual URL shown + expected URL).
  • Copy (or screenshot) of the .htaccess file .htaccess — or indicate that it is missing.
  • Actions already attempted (permalinks reset, plugins disabled, theme changed, cache purged).
  • If possible: screenshot of the cPanel File Manager (file .htaccess .htaccess visible) and a screenshot of phpMyAdmin if you modified siteurlsiteurl.
  • Mention if the site is behind a CDN or a reverse proxy (Cloudflare, Varnish, Nginx).

Limitations and precautions

  • If you do not have cPanel or SFTP access, ask support to perform the checks (activate mod_rewrite mod_rewrite, restore .htaccess .htaccess, and check the server logs).
  • Only modify the database (phpMyAdmin) if you have previously exported the SQL.
  • Changes to Apache (activation of modules, AllowOverrideAllowOverride) require server administrator rights; contact support.
  • For Nginx environments, the fix is done via the server configuration and not via .htaccess .htaccess — provide the try_files try_files snippet to support if necessary.

Useful templates

.htaccess — WordPress at the site root

# 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

.htaccess — WordPress in a subfolder (/blog/)

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
# END WordPress

Nginx snippet to provide to support

location / {
    try_files $uri $uri/ /index.php?$args;
}

I can help you

If you wish, I can:

  • prepare the .htaccess file .htaccess adapted to your subfolder (indicate the site's exact path),
  • or produce a list of items to send to support (example URL, copy of .htaccess, .htaccessactions attempted) to expedite the support team's intervention.

Internal resources

Public sources consulted

Reference documentation

  • Settings Permalinks screen — WordPress.org (documentation)
  • Apache HTTP Server: mod_rewrite Introduction (httpd.apache.org)
  • WP Toolkit Command Line Interface — cPanel documentation

Documentation consulted on October 16, 2026. Tools may vary depending on your hosting.