You have just moved your WordPress site to a new host. The homepage loads fine but every other page — service pages, blog posts, contact — returns a 404 error. This is one of the most predictable post-migration problems, and in almost every case it is caused by a missing or incorrect .htaccess file on the new server, not by any problem with your content.
Why 404s appear after a WordPress migration
WordPress relies on Apache's mod_rewrite module to route all page requests through index.php. The routing rules are stored in .htaccess at the root of your WordPress installation. When you migrate to a new server, .htaccess may not transfer correctly, may be blocked by the new server's configuration, or the new server may not have mod_rewrite enabled — meaning WordPress cannot match any URL except the homepage.
Fix 1: Flush permalinks (try this first)
In your WordPress dashboard, go to Settings → Permalinks. Without changing anything, click Save Changes. This regenerates the .htaccess file with the correct rewrite rules for your current permalink structure. Load a few inner pages to test. This fixes the problem in the majority of post-migration 404 cases.
Fix 2: Manually restore the .htaccess file
If flushing permalinks does not work, connect to your server via FTP and check whether a .htaccess file exists in the root WordPress directory. If it is missing, create it. The standard WordPress .htaccess content is:
# 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 WordPressFix 3: Update the site URL in the database
If your domain changed during the migration, WordPress still has the old domain hardcoded in the database. Go to phpMyAdmin in your hosting panel, open your WordPress database and find the wp_options table. Look for siteurl and home and update both to the new domain. Without this, WordPress redirects incorrectly regardless of your .htaccess.
Fix 4: Check mod_rewrite is enabled on the new server
If .htaccess looks correct but 404s persist, the new server may not have mod_rewrite enabled. Ask your hosting provider to enable it. On Nginx servers, .htaccess is not used at all — Nginx needs a try_files directive in the server block configuration. Contact your host if the server type changed during the migration.
ImportantIf the domain changed, also run a full database search-replace to update all hardcoded HTTP URLs. Use the Better Search Replace plugin to change every instance of the old domain to the new one across all database tables. Missing this causes broken images, incorrect canonical tags and mixed-domain internal links even after the 404s are resolved.