My friend has come to me today to tell me he wants his wordpress site moved from example.com to example2.com.
I have full access to the same server managing both those URLs, I copied the entire file and folder contents that apply to example.com over to example2.com so that both domains are 100% duplicate.
When I tried accessing everything on example.com, everything works. However, when I tried accessing the wordpress pages on example2.com, I get redirected to example.com but the rest of the URL is the same.
I checked .htaccess in example2.com as well as the server httpd.conf files and nothing there shows any signs of redirect. However, when I modified a PHP file (so that all it does is print a word instead of loading all the wordpress stuff), there are no redirects and the word is displayed. So this suggests to me that something in wordpress is causing the redirects.
I suggested to my friend to login to wordpress and enter some settings section to change the base domain of the site from example.com to example2.com but I believe he does not know how to do that.
Another possibility is that I find some sort of configuration file or database entry that points to the domain or some setting in relation to it?
As a last resort, I could delete all the work my friend put into his wordpress site and do a clean re-install but I don't think he would appreciate that.
So what would be the best course of action? and if I go about changing settings, what database fields or files should I change so that anything wordpress related that is requested on example2.com doesn't get redirected to the same resource on example.com?