WordPress 404 errors after migration: fix
Home page loads but every other page is 404 after moving WordPress? Fix permalinks, .htaccess and server rewrites safely. Call (804) 375-4450.
At a glance
If your home page works after a WordPress migration but every other page says Not Found, pretty permalinks are not being routed on the new server. Re-save permalinks first. If that fails, the missing piece is usually a hidden .htaccess file on Apache or LiteSpeed, or a rewrite rule in the Nginx configuration. Your content is almost always safe in the database.
Updated November 29, 2026 · For site owners whose pages return 404 after a move
- For owners whose site shows 404 on inner pages after a host or domain move
- Fastest test Settings, then Permalinks, then Save Changes
- Usual causes missing .htaccess, Nginx without a rewrite rule, wrong site address
- Safe check /?p=ID opening the page proves content and database are fine
- Help migration service, or emergency support with a 15-minute response
- Pricing rescue is pay-only-if-fixed; the quote comes before work starts
On this page
If your home page works after a migration but other pages say "Not Found", WordPress's pretty permalinks are not being routed. Re-save permalinks first; if that fails, the new server is missing its rewrite rules.
What does this error mean?
With pretty permalinks, a URL like /about/ does not match a real file. The server must hand it to WordPress's index.php, which finds the page. That needs a rewrite rule. A migration can leave the old rules behind, or the new server may not have rewriting enabled.
What are the common causes?
| Cause | Where it happens | Fix |
|---|---|---|
| Rewrite rules not flushed | WordPress | Re-save permalinks |
Missing or incomplete .htaccess | Apache or LiteSpeed | Recreate the standard block |
| No WordPress rewrite rule | Nginx | Host adds a try_files line |
mod_rewrite off or AllowOverride blocking | Apache | Host enables it |
| Wrong WordPress or Site Address | Settings, General | Correct domain and protocol |
| Subfolder install with root rules | .htaccess | Rules written for the subfolder |
What are the safe steps?
Back up files and database first.
- Re-save permalinks
In wp-admin, go to Settings, then Permalinks, and click Save Changes without changing anything.
- Check the rewrite rules
for your server (see the tabs below).
- Check the addresses
Under Settings, General, confirm WordPress Address and Site Address match the new domain and protocol.
- Temporarily switch to Plain permalinks
If pages load with
?p=123URLs, rewriting is the issue, not your content. Switch back afterwards. - Test a few URLs,
including a post, a category and a custom post type.
Which rewrite rule does my server need?
Check the .htaccess file in the WordPress root. For a standard single-site install it should contain this block. If the file is missing, create it with that content, copying any other custom rules over first.
# 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 WordPressAsk the host to confirm mod_rewrite and AllowOverride All for your folder.
Nginx ignores .htaccess. The host or developer adds this line to the site's location / block:
try_files $uri $uri/ /index.php?$args;How do I tell which cause I have?
First, does a plain link such as /?p=1 open the right post? If yes, content and database are fine and routing is the problem. Second, which server runs the site? Ask your host, because the fix differs. Third, are the addresses correct? A site still pointing at the old domain can produce 404s or send you back to the old server. If posts work but custom post types or WooCommerce pages 404, re-save permalinks again. If only images 404, the uploads folder may not have been copied, which is a file transfer problem.
A short worked example
You moved a site on the same domain and /about/ shows a 404. You open /?p= plus the About page ID and it loads, so the database is fine. Re-saving permalinks changes nothing, so you check the WordPress root over SFTP and find no .htaccess, because the dot file was skipped in the copy. You create it with the standard block and the pages return. Hidden files are the commonest casualty of a manual move.
How do I confirm the fix?
Open a post, a page, a category and a custom post type URL in a private window.
Check images and downloads load from the uploads folder.
Submit a form and test login.
Spot-check URLs from your sitemap; they should return 200.
If you changed address or protocol, check old addresses redirect rather than 404.
A host cache can keep serving a stored 404 after the cause is fixed, so ask for it to be cleared.
When should I stop and call someone?
Stop if you do not control server configuration, if there are redirects to the old domain you cannot find, if only some URLs fail, or if the database still holds old URLs that need a careful search-and-replace.
How do we fix it?
Our migration service handles the move including redirects and rewrites. Emergency support responds within 15 minutes with service credits if a live site is already broken, and rescue is pay-only-if-fixed.
What do the symptoms tell me?
| What you see | What it suggests |
|---|---|
| Home page works, inner pages 404 | Rewrite rules missing or not flushed |
/?p=ID opens the right page | Content and database are fine; routing is the problem |
| Posts work, custom post types 404 | Re-save permalinks; check the plugin that registers them |
| Images 404 | The uploads folder was not copied across |
| Redirects to the old domain | Wrong WordPress or Site Address, or old URLs in the database |
A person reads it, at any hour.
Why does only the home page work?
The home page is served directly. Every other page relies on URL rewriting, which is often not configured on the new server, so the request never reaches WordPress.
Link to this answerDo I have to re-save permalinks?
Usually it is the first thing to try. Saving the Permalinks screen makes WordPress rebuild its rewrite rules and, on Apache, rewrite .htaccess. It costs nothing and is reversible.
Link to this answerMy new host uses Nginx. Does .htaccess apply?
No. Nginx ignores .htaccess. The rewrite rule belongs in the server configuration, which your host or developer must change, typically with a try_files line in the location block.
Link to this answerWill this hurt my search rankings?
Pages returning 404 can drop out of search while the problem lasts, so it is worth fixing quickly. Once pages return normally, search engines recrawl them.
Link to this answerWhy is there no .htaccess file after the move?
The file name starts with a dot, so it is hidden and easily skipped when files are copied manually. Create it with the standard WordPress block or re-save permalinks to have WordPress write it.
Link to this answerHow do I prove my content is not lost?
Open /?p= followed by a post or page ID. If it loads, the database and content are fine and the problem is URL routing, not data.
Link to this answerPosts work but my shop or custom post type pages show 404. Why?
Re-save permalinks again, then check that the plugin that registers those types is active. Rewrite rules are rebuilt from whatever is registered at the time you save.
Link to this answerCan I just search and replace the old domain in the database?
Not with a plain text replace. WordPress stores serialised data whose lengths change, and a blind replace can break it. Use a tool that understands serialisation, or ask someone who does.
Link to this answerA host cache keeps showing the 404 after I fixed it. What now?
A host-level cache or reverse proxy can serve a stored 404. Ask the host to clear it and confirm whether a cache layer sits in front of your site.
Link to this answerHow do I stop this happening on the next move?
Copy hidden files explicitly, record the web server type before choosing a host, and re-save permalinks as part of the post-move checklist. Test the new host before switching the domain.
Link to this answerCan you fix it for me?
Yes. The migration service handles the move including redirects and rewrites, and emergency support responds within 15 minutes if a live site is already broken.
Link to this answerWant an engineer on it?
Tell us what is wrong in plain words. A person reads it, today.