If the WordPress home page works but posts or custom routes return 404, the rewrite rules used by pretty permalinks may be stale or unavailable.
- Open WordPress → Settings → Permalinks.
- Save the permalink settings to refresh rewrite rules.
- Retest a normal post or page.
- Review
.htaccessif the site uses Apache-compatible rewrite rules and the problem continues. - Check whether a custom post type and a page use conflicting slugs.
Do not change DNS for a permalink-only 404 when the WordPress home page already reaches the correct server.