Skip to content
Fix Library

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

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?

CauseWhere it happensFix
Rewrite rules not flushedWordPressRe-save permalinks
Missing or incomplete .htaccessApache or LiteSpeedRecreate the standard block
No WordPress rewrite ruleNginxHost adds a try_files line
mod_rewrite off or AllowOverride blockingApacheHost enables it
Wrong WordPress or Site AddressSettings, GeneralCorrect domain and protocol
Subfolder install with root rules.htaccessRules written for the subfolder

What are the safe steps?

Back up files and database first.

  1. Re-save permalinks

    In wp-admin, go to Settings, then Permalinks, and click Save Changes without changing anything.

  2. Check the rewrite rules

    for your server (see the tabs below).

  3. Check the addresses

    Under Settings, General, confirm WordPress Address and Site Address match the new domain and protocol.

  4. Temporarily switch to Plain permalinks

    If pages load with ?p=123 URLs, rewriting is the issue, not your content. Switch back afterwards.

  5. 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 WordPress

Ask the host to confirm mod_rewrite and AllowOverride All for your folder.

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?

  1. Open a post, a page, a category and a custom post type URL in a private window.

  2. Check images and downloads load from the uploads folder.

  3. Submit a form and test login.

  4. Spot-check URLs from your sitemap; they should return 200.

  5. 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.

Moving without downtime means rewrite rules move too

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 seeWhat it suggests
Home page works, inner pages 404Rewrite rules missing or not flushed
/?p=ID opens the right pageContent and database are fine; routing is the problem
Posts work, custom post types 404Re-save permalinks; check the plugin that registers them
Images 404The uploads folder was not copied across
Redirects to the old domainWrong WordPress or Site Address, or old URLs in the database
Pages still returning 404?

A person reads it, at any hour.

FAQ

Questions people ask

11 answers. Can't find yours? Ask an engineer.

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 answer
My 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 answer
Will 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 answer
Why 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 answer
How 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 answer
Posts 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 answer
Can 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 answer
A 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 answer
How 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 answer
Can 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 answer

Want an engineer on it?

Tell us what is wrong in plain words. A person reads it, today.