To solve this issue you will need to reconfigure your permalink settings or manually update your rewrite rules.
1. Log in to the WordPress Dashboard.
2. Go to Settings » Permalinks, and simply click on the Save Changes button.
This will update your permalinks settings and flush rewrite rules. In most cases, this solution fixes the WordPress posts 404 error.