VPS Tutorials
WordPress posts return 404 but the homepage works? Fix permalinks and rewrites (2026)
Fix WordPress posts returning 404 while the homepage loads. Check permalinks, Nginx or Apache routing, post status and caches without changing every URL.

If your WordPress homepage loads but posts return 404, start with the existing permalink rules. Keep the current URL structure, visit Settings → Permalinks, save without changing it, and retest. If several published posts still fail, check the web server's WordPress routing before reinstalling anything.
This guide covers a regular single site. Multisite networks, subdirectory installations and proxy setups need configuration that matches their actual paths.
| What fails? | Start here | Avoid this shortcut |
|---|---|---|
| Most posts, while the homepage loads | Permalink and server routing rules | Reinstalling WordPress |
| One post only | Publication status and current URL | Editing global server rules |
| Posts after a migration | Site directory and migrated configuration | Assuming the database is the whole site |
| One content type, such as products | Its plugin and routing | Disabling the plugin that provides those pages |
| Too many redirects instead of 404 | Redirect and HTTPS settings | Repeated permalink saves |
For the last case, use the WordPress and Cloudflare redirect-loop checklist.
In Settings → Permalinks, record the current selection, custom structure and category/tag bases. Keep their values and click Save Changes once. Test the original failing URL in a private window.
The permalink settings documentation notes that visiting this screen already flushes rewrite rules. There is no need to keep switching structures. Test two or three published posts; if the problem remains, identify the actual web server.
If a forgotten password prevents access, follow the WordPress password recovery guide first.
Find it under Posts → All Posts. Confirm it exists and is publicly published; a preview is not evidence of public availability. The post status reference explains the distinction.
Copy the current address using View Post. Compare it with the failing menu item or bookmark. If only the old address fails, fix that reference. For an intentional permanent move, redirect the old article to its corresponding replacement, following Google's redirect guidance.
Avoid changing slugs as a diagnostic step. Check the existing permalink structure, including any category component. An ID-based ?p=POST_ID request can redirect to the canonical address, so it is not an independent test of every routing layer.
Use the hosting panel or ask support to identify the actual stack. An Nginx response header can come from a proxy in front of Apache. Back up the current configuration and .htaccess before editing, and confirm that a site backup is available.
In your domain's panel settings, inspect the WordPress rewrite template. Compare it with existing rules rather than replacing the entire site configuration.
Nginx does not read Apache .htaccess files; see the WordPress Nginx handbook.
For a direct Nginx setup with a single WordPress site at the domain root, an administrator can check whether the existing location / uses an appropriate fallback such as try_files $uri $uri/ /index.php?$args;. The Nginx directive reference explains the lookup and internal redirect. WordPress needs its PHP entry point, not a static app's index.html fallback.
This is a check, not a complete configuration. Edit the existing location rather than adding a duplicate. Test configuration before reloading, using the panel or nginx -t, and restore the saved version if the test fails.
Show hidden files in the hosting file manager and locate the directory containing WordPress's index.php. If the permalink screen says .htaccess could not be updated, back it up and use the rules generated for this installation to repair its WordPress section. Preserve unrelated rules.
The WordPress Apache handbook separates single-site and multisite rules. Do not delete the whole file or set every permission to 777.
If the file is present but ignored, ask support to check mod_rewrite and directory overrides. See the WordPress troubleshooting FAQ and Apache AllowOverride reference.
Purge affected page URLs from the caches you actually use, including host or CDN caches. A private window does not bypass a CDN.
For a failure following a plugin change, record the plugin and update time, then isolate changes on a staging copy. Keep the plugin responsible for a custom content type in mind: disabling it can remove that type's routing. The plugin management guide covers investigation.
After a move, compare the new directory and web configuration with the WordPress migration checklist.
- Open the homepage, two posts and a category archive in a private window.
- Follow menu and internal links, then refresh a post directly.
- Check on a phone as well.
- Inspect the main document in Network when checking HTTP status: a working article should ultimately return 200 with the correct content.
- Test a genuinely nonexistent path; it should still return 404, not the homepage with a 200 response.
Google explains its treatment of missing pages in the HTTP status documentation. Recheck affected URLs in Search Console after repair; indexing and traffic recovery have no fixed deadline.
For support, send the failing URLs, time, recent change and this result: “Homepage works; multiple published posts return 404 after refreshing the unchanged permalink settings. Please check this domain's document root, actual web server and WordPress rewrites, preserving the current configuration first.” Do not send your admin password.
Next step: compare the actual plans
Filter the listed plans by budget, specifications and region, or start with a buying guide.