Website redirecting to old domain name

I was developing website on test.example.com on a separate server. Meanwhile, the working server was example.com at GoDaddy.

The WordPress website was working fine on both servers. But then I changed the registrar and decided to change the WordPress on test.example.com to example.com inside of the wp-config.php. If I’m entering example.com/wp-admin – it opens without problem. However, when I try example.com it redirects to test.example.com.

Can’t figure out why it’s happening.

2 Answers
2

There are a few variables that need to be changed in order for you to update to the new link on your WordPress site.

As mentioned by Mark, try the following steps using the Search Replace DB tool:

  1. Go and download Interconnect IT’s Database Search & Replace Script here
  2. Unzip the file and drop the folder in your localhost where your WordPress is installed (the root) and rename the folder to replace (screenshot)
  3. Navigate to the new folder you created in your browser (ex: http://example.com/replace) and you will see the search/replace tool
  4. It should be pretty self-explanatory up to this point: enter your old URL in the search for… field and the new URL in the replace with… field

You can click the dry run button under actions to see what it will be replacing before you execute the script. Once you’re done be sure to remove the /replace/ folder.

Leave a Comment