To troubleshoot this error, we have to look at a few different things.
One, this could be caused by .htaccess file that is corrupted, deleted or something went wrong with your coding of the rewrite roles. To fix, let’s go to our WordPress dashboard.
Once logged in go down to settings and then go to permalinks and you do not need to edit anything at this point. Simply click save changes. This will automatically create .htaccess file and then refresh your website.
Now simply go to a blog post and see if your website is working. If you can now see your blog post, you know that the .htaccess file was deleted or missing and now you have a functioning website.
If this did not fix your website problem, simply go again to your web server via the FTP.
We currently using Filezilla. If you followed the previous solution, now you should have a .htaccess file.
Simply right-click and view and edit this file, or you have the option to download to your computer and edit it there. Look at your file and see if this code is within your file. If it is not, simply add this piece of code and save and refresh your website.
Typically, these solutions fix most WordPress post returning 404 errors that you might find while using WordPress.