Key points
- Your content is fine; the URL rewrite rules are missing.
- Re-saving permalinks fixes most cases.
- Otherwise check .htaccess or the Nginx configuration.
After changing host or folder, the home page works but every post and page says “Page not found”. Your content is safe in the database. The server simply no longer knows how to turn pretty URLs into WordPress requests.
Step 1: re-save permalinks
Go to Settings → Permalinks and click “Save” without changing anything. WordPress regenerates its rules and tries to rewrite .htaccess. That is enough in most cases.
Step 2: check .htaccess (Apache, LiteSpeed)
The file in the WordPress root must contain this block. If it is missing, empty, or was never copied (dot files are often hidden), recreate it:
# 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
If WordPress lives in a subfolder, adjust RewriteBase and the last line (/subfolder/index.php).
Step 3: Nginx servers
Nginx ignores .htaccess. The site config needs try_files $uri $uri/ /index.php?$args; in the location / block. On shared hosting, ask support.
If it still fails
- mod_rewrite is disabled: ask your host to enable it.
- An
AllowOverride Nonedirective stops Apache reading .htaccess. - A caching plugin serves old pages: purge it after each change.
FAQ
My domain changed too. Is that related?
That is a separate issue: replace the old domain in the database (WP-CLI or Better Search Replace).
Do I need 301 redirects?
Only if the URL structure changed. If it is the same, fixing rewrites is enough.
Facing this on your site? We diagnose and fix it without putting your content at risk.



