WordPress Permalinks Not Working? How to Fix 404 Errors on Pages & Posts
WordPress permalinks broken? Inner pages 404 while the homepage loads? Here's how to fix rewrite rules, .htaccess, Nginx, slug conflicts, and WooCommerce endpoints—fast.

The homepage loads. Every other page gives a 404. The content is still there. WordPress just forgot how to route URLs. This is almost always fixable in a few minutes.
Fix 1: Save the Permalinks Screen
Go to Settings → Permalinks. Don't change anything. Just click Save Changes.
That's it. WordPress rebuilds its URL routing rules. Test your pages again.
If that fixed it, you're done. If not, keep reading.
Fix 2: Reset .htaccess (Apache Hosts)
If saving permalinks didn't work, your .htaccess file is probably missing or broken. This file lives in your WordPress root folder.
Connect via FTP or your hosting file manager. Back up the current file. Then replace its contents with this:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Save. Test your pages. If it works, set the file permissions to 644. Never 777.
Fix 3: Check Your Server Type
Apache: Use the .htaccess fix above.
Nginx: .htaccess does nothing. Ask your host to add this line to your site's Nginx config:
try_files $uri $uri/ /index.php?$args;
If you're not sure which server you're on, ask your host. Don't paste Apache rules into Nginx. They don't work the same way.
Fix 4: Only One Page 404s? Check for a Slug Conflict
If every other page works but one doesn't, two things are fighting for the same URL. Common culprits:
- A page named "Blog" and a category with the slug
blog - A parent page moved to Draft, breaking all child page URLs
- A custom post type with the same slug as a regular page
Rename the failing page's slug temporarily. Change /services/ to /our-services/. If the 404 disappears, that was the conflict.
Fix 5: WooCommerce Pages 404? Check Endpoint Assignments
If your cart, checkout, or account pages 404, WooCommerce lost its page assignments.
Go to WooCommerce → Settings → Advanced. Make sure Cart, Checkout, and My Account each have a valid page selected. Save. Then go back to Settings → Permalinks and click Save Changes again.
Fix 6: Still Broken? Clear Caches and Check the Site URL
Clear your caching plugin, your CDN, and your browser cache. Test in a private window.
Then check Settings → General. Make sure WordPress Address (URL) and Site Address (URL) match exactly. No http vs https mix. No www vs non-www mix.
If you recently moved the site, use a search-and-replace tool to update old URLs. Don't do a raw database find-and-replace. It breaks serialized data.
That's It
Most permalink problems are fixed by saving the Permalinks screen or resetting .htaccess. The other fixes handle the rare cases. Work through them in order. Don't skip ahead.
Share





