•

Homepage works but every other page is a 404 after a move

WordPress pages don’t exist as separate files. When someone visits /about/, the web server has to be told to hand that address to WordPress, which then looks up the page in the database. That instruction lives in a small set of “rewrite rules”. The homepage works without them, because it’s just the main index.php. Every other page depends on them. So if they didn’t make the move, you get exactly this: a working homepage and 404s everywhere else.

Is this what you’re seeing?

  • Your WordPress homepage works but other pages show 404 or “Not Found” after moving host.
  • Permalinks stopped working after changing hosting, though every page is still listed in wp-admin.
  • The 404 page is a plain server page, not your theme’s own “page not found” design.
  • wp-admin works, but posts, products, categories or event pages don’t.
  • Your WordPress website is generating 404 errors in Search Console since the move.
  • Everything was fine on the old server, and you were told the migration was “done”.

What usually causes it

The .htaccess file didn’t come across

On Apache and LiteSpeed servers, the rewrite rules live in a file called .htaccess in the site’s main folder. Because its name starts with a dot, it’s a hidden file, and many FTP programs and file managers don’t show or copy hidden files unless you ask them to. Some server setups never had one at all: Bitnami packages, common on cloud servers, often keep the rules in the server’s own configuration instead, so there’s no file to copy. How to tell: turn on “show hidden files” in the new host’s file manager and look in the folder that holds wp-config.php. No .htaccess, or one without a “BEGIN WordPress” section, points here.

The server is set to ignore .htaccess

The file can be there and still do nothing, if the server isn’t set up to read it or doesn’t have its rewrite module switched on. This is more likely on a server you or a developer set up yourselves than on managed WordPress hosting. How to tell: the file exists and has the standard WordPress section, saving permalinks makes no difference, and the 404 page is the server’s plain one.

The new server uses Nginx

Nginx doesn’t read .htaccess files at all. The equivalent rule goes in the server’s own configuration, which on most hosting only the host can change. If you’ve moved from an Apache host to an Nginx one, the rule that used to live in your files now has to live in theirs. How to tell: your host’s documentation or support will tell you which web server you’re on. Some hosts’ control panels show it too.

The site moved folder, or the addresses are still the old ones

If the site moved into or out of a subfolder, the rules need to point at the new location. And if the site’s own address in Settings → General still points at the old domain or a temporary address, links can lead to pages that don’t exist on the new server. How to tell: hover over a menu link and check the address it goes to. A different domain, a staging address or an extra folder in it points here. My guide to a site that broke after a move covers old addresses in more detail.

What you can safely try

Take a backup first, of the new site as it is. These steps don’t touch your content.

  1. Look at the 404 page itself. If it’s your theme’s own “page not found” design, WordPress received the request and couldn’t match it, which points to addresses or a plugin. If it’s a plain server page, WordPress never saw the request at all, which points to the rewrite rules. Check in wp-admin that the pages are still listed, so you know the content made the move.
  2. Go to Settings → Permalinks and click Save Changes without changing anything. WordPress rebuilds its rules and, if it can, writes them to .htaccess. Then try a page in a private window.
  3. If the permalinks screen says it couldn’t write the file, or nothing changed, open the file manager, turn on hidden files and look for .htaccess in the folder with wp-config.php. If there is one already, download a copy first so you can put it back.
  4. If there’s no file, create one called .htaccess in that folder containing WordPress’s standard rules, below. This is for a site in the main folder of the domain, on Apache or LiteSpeed hosting. To undo it, delete the file you created, or put your downloaded copy back.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
  1. Clear every cache, including Cloudflare if you use it, because 404 pages can be cached too. Then check again in a private window.
  2. If it still doesn’t work, ask your new host: “The homepage loads but WordPress permalinks give a 404. Can you check the rewrite rules are allowed and working for my site?” That’s a request they get often.

When to stop and get help

  • You’re on your own server or a cloud instance and the fix means changing the web server’s configuration.
  • The old .htaccess had other rules in it, such as redirects or security settings, and you’re not sure which still apply.
  • Some pages work and others don’t, or the content itself looks incomplete. The move may have missed more than one file.
  • The DNS has already been switched, so customers are seeing the 404s on the live site.
  • You’re being told to search and replace in the database to fix the addresses. That’s best done by someone who’s done it before, with a backup.

A real example

A London restaurant’s site was running on an older Bitnami WordPress package on a cloud server, and needed to move to managed hosting. That kind of setup needs direct server access to move properly, so I moved it over SSH. The site had about 2GB of files and a database of several hundred megabytes. I found the WordPress installation on the old server, transferred the files, exported and moved the database, and made sure the Elementor and Elementor Pro versions known to work together stayed as they were. Getting those versions out of step is a separate problem, which I describe in Elementor and Elementor Pro out of step.

On the new host, the homepage worked and the internal pages returned 404s. The files and database were all there. What wasn’t in place was the Apache rewrite configuration the site expected: the .htaccess rules. I identified that as the thing that needed fixing on the new host.

It’s a good illustration of why a migration is more than copying files and importing a database. The new server has to be set up the way the site expects: addresses, PHP version, rewrite rules and plugin versions. A site that “works” because the homepage loads isn’t finished. If you’re planning a move, moving WordPress to a new host covers the checks I do before switching DNS.

Getting it fixed

Tell me where the site moved from and to, and send a link to one page that’s showing the 404. I check the rewrite rules, the server setup and the site’s addresses, fix what’s missing, and test every type of page, not just the homepage. A WordPress repair is a fixed £119, which covers finding the problem and up to 90 minutes of fixing it. Most repairs fit in that, and you’re never charged more without agreeing first.

Questions

Can someone fix .htaccess problems after a migration?

Yes, and it’s usually quick once the cause is clear. I need access to the new hosting’s file manager or SFTP and a WordPress login. If the old server is still running, I compare the two, so any extra rules from the old setup aren’t lost.

Can you migrate a Bitnami WordPress site, or one on AWS Lightsail?

Yes. Bitnami installs lay things out differently from ordinary hosting, and a migration plugin doesn’t always cope, so I usually move them by hand over SSH and check the new host’s setup before anything is switched. See moving WordPress to a new host.

Only my category, product or custom pages return 404. Is it the same problem?

Often a related one. If normal pages work but categories, products, events or other custom page types don’t, saving the permalinks again usually fixes it. If not, a plugin that creates those page types may be inactive or set up differently on the new site.

Should I switch permalinks to “Plain” to make it work?

Not on a live site. It makes pages load, but it changes every page address, which breaks links people have saved and the addresses Google knows. Saving the permalinks without changing them, and checking whether the 404 is the server’s page or your theme’s, tells you what you need to know without changing anything.

Will the 404s hurt my Google rankings?

If they’re fixed within a day or two, the effect is usually small, because Google checks again. If pages stay missing for weeks, they can start dropping out of results. Once it’s fixed, use Search Console’s page indexing report to see which addresses Google still thinks are missing.

Written by Peter Claridge, who fixes WordPress sites for businesses across the UK from Reading. Last checked on WordPress 7.1, November 2026.