Magento 2 Error ERR_TOO_MANY_REDIRECTS
I'm new to Magento, after installation of Magento 2 community edition.I am not able to access the admin panel. I am getting below error.
This web page has a redirect loop
Please help me to resolve the issue. Advance thanks to all.
In my case, I was importing an already existing Magento 2 database. The reason I was getting the error was because of the cookie domain in the database. Go to your database and look in the table
core_config_data. You should see a path called
web/cookie/cookie_domain. Make sure the domain matches the one you installed Magento 2 on. Ex: If you installed Magento 2 on
local.dev/<magento-root> the entry in
web/cookie/cookie_domain should be
I had same problem manipulating databases, this answer resolved my problem ERR_TOO_MANY_REDIRECTS :
To correct this, please try to set Use Secure URLs in Admin to true, in System -> Config -> General -> Web.
Or with database access, change following record value to 1 :
SELECT * FROM core_config_data where path like '%web/secure/use_in_adminhtml%';
I refer to your magento store domain as example.com in this post. If its www.example.com or store.example.com or whatever, substitute accordingly.
I just ran into this issue and here are the specifics. Magento 2 2.2.2 install. I had configured the secure base url's to http://example.com/ initially and as I was getting my letsencrypt ssl cert configured on my server, I thoughtlessly enabled the option to redirect all http traffic to https.
This wouldn't be an issue normally, but Magento can be a bit temperamental. I visited my storefront and my SSL is working correctly, but as I attempted to access admin, I received the "ERR_TOO_MANY_REDIRECTS" notice and a failed page load.
I see several ways to fix this issue but the one that worked for me first attempt was this.
- SSH into server.
- cd to your magento install dir.
- run the following command:
- php bin/magento config:show
view the output and look for web/secure/base_url, web/secure/base_link_url & web/secure/use_in_adminhtml.
These values should be configured with https://example.com/ for the url options and web/secure/use_in_adminhtml = 1.
If they are not, you can run the following commands from your magento install directory to update your configuration.
- php bin/magento config:sensitive:set web/secure/base_url https://example.com/
- php bin/magento config:sensitive:set web/secure/base_link_url https://example.com
- php bin/magento config:set web/secure/use_in_adminhtml 1
- php bin/magento cache:clean
After that, visit your admin page, clear your browser cache, reload, and you should now have your access back! with SSL support.
First step I would take after that is to log back into the admin portal and verify your configuration options to ensure you arent going to run into any other unexpected problems.
I hope this help!
Here are some Magento resources to help guide you:
Set Configuration Values
Other Configuration Paths Reference
Sensitive and System Specific References