Just a couple of days ago, I was doing some website migration of some of my wordpress websites to its new web host, and being the “practice what you preach” type of guy, I followed my tutorial on how to migrate a wordpress website. It was going well so far or as what I have thought, since after already migrating two of my sites, I thought that the migration process was successful because I was able to go to the homepage of those websites without any issues whatsoever, however, when I tried to click and visit some of the posts and pages of one of the sites, I was welcomed by this message and got the surprise of my life
I also tried to do the same thing on the other website and the same thing happened – all the posts and pages of the websites aside from the homepage are giving me a 404 error. Holy shit! What the fuck did I do wrong this time? That’s what I actually said. And with the help of google, I tried searching “404 error on pages after website migration”. Google provided several links for my query, but since I have too much pride, I did not bother to go through the links and also, I actually want to do the fixing by myself first, and aside from the fact that a bright idea just struck me which I thought could be the cause of the problem and the cause could be in the url addresses of the posts and pages since I have just migrated to the new server and it could still be using some data from my old host but to tell you the truth, I actually don’t know since it has not happened to me before, although I have already done migrating lots of my websites from webhost to webhost before, this error happening to me is actually my first time experience, so I am a bit sort of “lost” and bewildered, but pride still intact.
So what I did is I trusted my instincts and went to the permalink settings and tried to “refresh it” by selecting the option “Custom” and entering “/%postname%/” which is actually the old setting of my website, then I clicked “Save Changes”
And you know what? It actually worked like a charm!
So there you have it, in case you encounter the same issue like mine, you can try to do the same thing like I did by “refreshing” the permalink setting and see if it will solve your problem.
If for some reasons you also had the same problem but the solution did not work for you or you resolved it with a different method, just comment below so we can discuss