When you install your wordpress site on a new machine then don’t forget to add or change the .htaccess file to allow the permlinks to work properly without getting 404 page errors. What you need to add is right at the very bottom of the WP Admin Settings-> Permlinks administration page. Copy and paste that into the .htaccess file that is (or should be) at the document root of your web site.
If it is not there then you need to create this file. If you are using Windows and try and create a file called .htaccess on your local PC to upload to your web server then you will get an error “You must type a file name”.
Just call it htaccess.txt or similar and then edit that with the WP permlinks related changes and then upload that in FTP. Then rename the file on the server to .htaccess
As the server will be Unix-like then it won’t care about such a filename and now your permlinks will work and you won’t get 404 errors for your posts.