I have moved one of my website to a new domain, below is what i did.
- Backed up database
- Uploaded all the files to the new server.
- Imported sql into new server via
phpmyadmin
- Now i have used this script to change URL in database.
Now, problems i am facing are:
- All the links are going to old domain.
- All the images are linked to old domain.
-
wp-admin
is also redirected to old domain when i try to run mydomain.com/wp-admin
Please help if you have any ideas about this, any help would be greatly appreciated.
My issue is resolved, I am posting this as an answer so that someone else can benefit out of it.
My issue was, siteurl
and homeurl
were not updated, so I have placed define('RELOCATE',true);
in my wp-config.php
file. And again tried to access the website , it gone to the correct URL but all the CSS was gone.
Then I headed over to wp-admin
and it also came with no CSS but still I tried to login but this time it has taken me to the correct URL and with CSS login page but didn’t log in. Then again I attempted to login and this time I was successful.
Then I changed both the URLs from settings in the admin panel.
After this you must to delete all your browser cache files to delete any kind of persistent redirection.
Hope this helps someone else dealing with the same problem.