Recently, i have moved the server of my magento2 project. After moving to different server following steps i have taken.

1) Configured the Base URL in


2) Clear the Magento 2 Cache (Remove all the content inside var directory)

3) Perform php bin/magento indexer:reindex

4) Clear Browser Cookies and cache.


chrome says This webpage has a redirect loop for only admin screen while frontend working fine. I have checked with the other browsers but it has similar message of TOO_MANY_REDIRECTS

Prompt response to this issue will be highly appreciated.



2 Answers 2


I know you asked this a while ago, but I see that it is still unanswered.

You did the correct thing to change the Base URL in the core_config_data table. I would make sure to double check that you updated both the secure URL and the base URL.

But the issue seems that the admin login screen is stuck in a redirect loop.

I'd recommend checking the app/etc/env.php file to see what the backend name for the site is set to:

'backend' => 
  array (
    'frontName' => 'admin', //keep your custom url name here

The next place I'd look is at the URL rewrite table to make sure that there isn't a special rule that is redirecting to the older location.

And if this doesn't fix it, then this is likely an .htaccess rule that may be stuck in a loop.

I hope this helps!

  • I have a similar problem, and nothing you write seem to help. The base URL is correct (that's why the frontend opens all right), frontName is "admin", URL rewrite table was truncated, and it is not an .htaccess problem because the redirection headers are fiven by the Magento PHP scripts. Commented Dec 6, 2017 at 12:47
  • OK, the problem in my case was hostname/domain name containing an underscore "_", which is not allowed for hostnames (and filter_var($routePath, FILTER_VALIDATE_URL) returns false). Commented Dec 6, 2017 at 13:08

Do not keep '_' in your vhost url.

www.a_bc.co/admin (Won't work)


www.abc.co/admin (Will Work)


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.