
You have just finished working on your site and everything looks fine. The homepage works. But when you click on “About” or on a blog post… you get a 404 error – Page not found.
It is one of the most common errors in WordPress. And one of the most frustrating, because the content exists, but seems to have vanished.
In this article I explain why it happens, how to fix it (when it is simple) and when it is better not to improvise.
The problem: the homepage loads, but every other page returns a 404
It is a classic. The site is online, the content is there, but any URL other than the homepage returns an error. It happens on:
- Blog posts
- Secondary pages
- Custom pages (landing pages, products and so on)
And it can happen suddenly, after:
- Installing a plugin
- A WordPress update
- Changing theme
- Migrating or moving the site
Cause 1: corrupted permalinks
This is the most frequent cause. WordPress handles URLs through a structure called permalinks. If something breaks that mechanism (e.g. a missing or wrong .htaccess file), pages “no longer know” how to be served.
How to try fixing it:
- In WordPress, go to Settings → Permalinks
- Without changing anything, click “Save Changes”
This forces WordPress to regenerate its URL rewrite rules. If the problem was in the permalinks, everything should now work again.
Cause 2: missing or wrong .htaccess file
The .htaccess file sits in the site root and is essential for permalinks to work.
Sometimes it gets deleted, badly rewritten or does not have the right permissions.
Technical solution:
- Connect via FTP or your hosting file manager
- Check whether a
.htaccessfile exists - If it is empty or missing, create a new
.htaccessfile with this basic 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
Save and try again. Be careful: if you have custom rules (e.g. for security, caching or redirects), do not delete them.
Cause 3: a hosting or Apache problem
In some cases the hosting disables Apache’s mod_rewrite module, which is required for custom URLs. This happens mainly on shared environments or badly configured servers.
In this case there is nothing you can do on your own. Contact your hosting support and ask:
“Is the mod_rewrite module enabled on my hosting account? Can you check support for WordPress permalinks?”
Cause 4: plugin or theme conflicts
Some plugins (especially security, caching or redirect plugins) can interfere with URLs. A badly built theme can also override routing rules.
To test:
- Temporarily deactivate all plugins
- Switch to a default theme (Twenty Twenty-One or similar)
- Try opening a page again
If it works, reactivate them one at a time to find the culprit.
When not to improvise
If you cannot get into the WordPress dashboard, do not know what .htaccess is, or the site was recently migrated, do not take risks: every attempt can make things worse.
Many people who try to fix it themselves end up:
- Deleting important files
- Breaking the
.htaccessfile - Setting up wrong redirects
- Losing traffic or search rankings
Conclusion
If the homepage works but other pages return a 404, your content is not lost: WordPress simply can no longer handle the URLs.
In many cases it is easy to fix. If you want to start from a broader diagnosis, see also 5 common WordPress errors. If the problem persists, you can get in touch for a technical analysis.