i had the same problem after changing domains. i did everything of the above and it didn’t work. by chance i happened to go to settings and permalink and change it from custom structure (which I had set originally) back to default and back to custom again — saving each time. everything now works.