Short answer: In WordPress Admin, go to Settings > Permalinks and click 'Save Changes' to flush rewrite rules, or recreate standard WordPress mod_rewrite rules in .htaccess.
Resolve broken post URLs and 404 Not Found errors by regenerating WordPress rewrite rules and restoring the default .htaccess template.
Before you start: Back up your site files and database and download the backup to your own computer. How to take a full backup
Quick reference
| Fastest Fix | WP Admin > Settings > Permalinks > Click 'Save Changes' |
|---|---|
| Default .htaccess Path | public_html/.htaccess |
| Server Module | LiteSpeed Rewrite Engine |
Quick diagnosis
| Scenario & Suspected Cause | Immediate Action & Remedy |
|---|---|
| Broken WordPress permalink rules | Navigate to WordPress Admin > Settings > Permalinks and click 'Save Changes' to flush rewrite rules. |
| Missing mod_rewrite directives in .htaccess | Re-create standard WordPress .htaccess rewrite block via cPanel File Manager. |
| Incorrect domain Document Root | Inspect cPanel Domains interface to verify domain maps to intended directory. |
| Linux case-sensitivity mismatches | Ensure URL file requests exactly match disk casing (e.g. image.jpg vs Image.JPG). |
Steps
- Regenerate Permalinks in WordPress (90% of cases):
- Log into your WordPress admin dashboard.
- Navigate to Settings > Permalinks.
- Without changing any settings, scroll to the bottom and click Save Changes. WordPress flushes its rewrite cache and rebuilds
.htaccess.
- Restore Default WordPress .htaccess Manually:
- In cPanel File Manager, edit
public_html/.htaccess. - Replace contents with standard WordPress rewrite rules:
# 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 - Save changes.
- In cPanel File Manager, edit
Troubleshooting and tips
- Subdirectory Installations: If WordPress is installed in a subdirectory like
public_html/blog/, changeRewriteBase /toRewriteBase /blog/andRewriteRule . /blog/index.php [L].
Need more help? If you run into an error while following these steps, open a ticket with technical support and our team will look into it. Open a ticket