When the homepage works after migration but posts/pages return 404, WordPress is often installed correctly and the web server is not rewriting pretty permalinks to index.php as expected.
Symptoms
- Homepage loads but inner pages return 404.
- Old host worked; new host fails on pretty permalinks.
- Plain ?p=123 URLs work while /page-name/ does not.
- Only a subdirectory or staging-to-production migration is affected.
Common causes
The same visible WordPress error can have several causes. A reliable fix starts by matching the symptom to logs, request behavior and recent changes.
- Missing or incorrect .htaccess rewrite rules.
- Apache mod_rewrite/LiteSpeed/Nginx routing not configured.
- Wrong document root or subdirectory path.
- Permalink rules need regeneration.
- Migration changed site URLs inconsistently.
Safe diagnosis
- Test a plain query-string WordPress URL versus a pretty permalink.
- Inspect server rewrite configuration for the new environment.
- Verify document root and WordPress index.php location.
- Check home/siteurl and migrated links without mass-replacing blindly.
Production safety: create a recovery point before changing code, plugins, database values or server configuration. Business-critical WooCommerce sites should avoid random deactivate/update experiments during active traffic.
How the issue is fixed
- Regenerate WordPress rewrite rules.
- Install the correct Apache/LiteSpeed/Nginx routing configuration.
- Correct document root/subdirectory mapping.
- Repair URL configuration only where migration data is inconsistent.
Avoid this shortcut: Do not run unrestricted database search-and-replace without understanding serialized data and the intended source/target URLs.
When to request expert WordPress bug fixing
Professional troubleshooting is useful when the site is business-critical, the error returns after a temporary fix, wp-admin is unavailable, the failure began after a complex update/migration, or you cannot identify the responsible code from logs. WP•FIX focuses on the smallest safe change that restores the failing path and explains the root cause.
FAQ
Why does the homepage work but posts are 404?
The homepage can load directly from index.php while pretty permalink requests depend on rewrite rules.
Does saving Permalinks fix it?
It can regenerate rules, but it will not fix missing server rewrite support, wrong document roots or permission problems.
Can Nginx use .htaccess?
No. Nginx requires equivalent server configuration; .htaccess is an Apache/LiteSpeed mechanism.
Can you fix migration issues without moving the site again?
Usually. The current environment can be corrected if the files and database migrated successfully.
Need this WordPress issue fixed?
Send the URL, error message and what changed immediately before the problem started.
Request troubleshooting