I have backedup and installed my site on a new server underneath the new domain of


After the DB and file transfer I logged in and immediately got a 500 error. I then overwrote the .htaccess file to the default and renamed the plugin folder to plugins-rename and then tested again.

Now the site resolves, but then automatically redirects the browser to


I also forced the site to exist under it's new old.example.com within the WP-config file using the following commands


Any ideas where this redirection might exist as it can't be contained within a plugin so must be somewhere else?

1 Answer 1


Here's a clean and sure way that I follow when I migrate a WordPress to a new domain (or subdomain):

  1. Go and download Interconnect IT's Database Search & Replace Script here
  2. Unzip the file and drop the folder 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://old.example.com/replace) and you will see the search/replace tool
  4. In the "search for…" and "replace with…" fields:
    • Replace: https://example.com (old domain)
    • With: http://old.example.com (new domain)

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.

  • I performed all the actions you mentioned but I am still being redirected. Does the script only search the DB or does it also search the files? I did have a few errors I have a feeling that there is a hardcoded The table "wp_login_redirects" has no primary key. Changes will have to be made manually. was one of the errors I got which might mean the issue resides in this area? Any other ideas of how to spot where a redirect might be being issues when i visit the site?
    – kinnth
    Commented Dec 27, 2016 at 22:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.