WordPress site redirects to different wordpress domain on the same server after reuploading db backup

5 WordPress sites (that is all of them) on our server (Apache, Ubuntu) were infected by some malicious code injecting javascript. I have deleted all the wp databases that were full of the injections and reuploaded them back from a backup. Almost all is well now, but one of the WordPress sites from one domain now redirects automatically to another WordPress on a different domain, which shouldn’t be happening. Both domains and WordPress installations are hosted on the same server and worked just fine before. The database seems to be ok, .htaccess seems to be unchanged, I certainly haven’t changed any domain configuration files on the server, plus I checked them and they seem unchanged as well. I have no idea where the problem is. Could you, please, point me to a probable cause? I have very limited experience with sorting out this kind of troubles. Thank you.

2 Answers
2

Use a tool like phpMyAdmin to check your databases directly.
Open the (your db prefix)_options table in the database for the problem site.
Then check the row where option_name = siteurl and see if the option_value is correct.
If not, correct it and you will be able to login to the wp-admin of that site.
You may still need to correct other urls too; this is a good tool for changing urls.

Leave a Comment