Redirect loop on WP Admin after migration to new host…?

Hi. I recently migrated the site http://swordsnblades.com.au from a CloudWays server to a cPanel based one. We also changed the URL to http://swordsnblades.com. I did several other sites at the same time, and the others didn’t have any issues. This site is unique in that we changed the URL, it’s running WooCommerce, and it has a custom child theme. The front end is working. However, the WP Admin gets stuck in a redirect loop.

I’ve disabled plugins in the database. I’ve changed the theme to TwentyFifteen. I’ve tried doing a new .htaccess. I’ve tried just removing it altogether. With no .htaccess the front end works, the Admin gives an error:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@swordsnblades.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Apache/2.2.29 (Unix) mod_ssl/2.2.29 OpenSSL/1.0.1e-fips mod_bwlimited/1.4 Server at swordsnblades.com Port 80

I’ve tried re-uploading all WP core files, theme files, etc. I’ve got debugging enabled (both front-end and debug.log. But the redirect doesn’t seem to register anything. Is there some way to see what my browser is doing to get an idea of what the redirect loop is? Like if I knew what was causing it, I might be able to figure it out. Other than that, I’m kinda at the end of my knowledge. I’ve done a bunch of Googling and tried a number of things. But cannot seem to figure out why/where the problem lies. Any ideas or help much appreciated.

  • Vaughan
    • Ex Staff

    Hi Tevya,

    Hope you’re well?

    This looks more like an issue with htaccess, though you say you checked that.

    I’m gathering this is just a single install & not a multisite?

    How did you change the domain?

    Did you also search in the DB and replace all occurrences of the old domain with the new domain? if not, this could also be why.

    Did the site have any cache plugins installed, if so, then there could still be cache files referencing the old domain.

    Hope this helps

  • Tevya
    • Recruit

    Hi Vaughn. I replaced the .htaccess with the basic stuff from WP.org. I’m not very versed in .htaccess speak. Single site. We used BackupBuddy to migrate the site, which changes all the important URL’s in the DB. But I also ran a find and replace. There’s currently no references to the old URL of swordsnblades.com.au. I’ve disabled all plugins, and deleted any caching referenced folders. Most handle a lot of that in .htaccess, but since it’s stripped down to the basics. I don’t see how it could be loading anything from that. I even removed the redirection from swordsnblades.com.au to swordsnblades.com to make sure that wasn’t part of it. But it does not appear to be trying to load the WP admin at the old .com.au domain. I looked at dev tools network tab and see it’s giving a 302 redirect. But no idea how/why/where…?

  • Predrag Dubajic
    • Support

    Hi @Tevya Washburn,

    Sorry for the delay on this one.

    Can you please try one of these solutions and check if it works in your case.

    Check the permissions of your wp-login.php and /wp-admin/index.php files, if they are set to 664 try changing them to 644 and see if that works.

    Another thing you can try is adding this code at the beginning of your functions.php file:

    flush_rewrite_rules();
    exit;

    Save the file, refresh site, remove the code and then refresh again.

    Let us know if this worked for you.

    Best regards,

    Predrag