You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Magento 2.2.2后台页面出现ERR_TOO_MANY_REDIRECTS错误求助

Fixing ERR_TOO_MANY_REDIRECTS in Magento 2.2.2 Admin

Hey there, let’s tackle that frustrating redirect loop you’re hitting when trying to access your Magento 2.2.2 admin. Based on your site’s base URL (http://staging.manohar.com), here are the most reliable fixes to try:

1. Verify Base URL & Secure URL Configurations

Since you can’t access the admin panel, you’ll need to update these settings directly via the database. Connect to your database and run these commands:

  • First, check your current URL settings:
    SELECT * FROM core_config_data WHERE path LIKE '%base_url%';
    
  • Update the unsecure and secure base URLs to match your staging site (don’t forget the trailing slash):
    UPDATE core_config_data SET value = 'http://staging.manohar.com/' WHERE path = 'web/unsecure/base_url';
    UPDATE core_config_data SET value = 'http://staging.manohar.com/' WHERE path = 'web/secure/base_url';
    
  • If your site isn’t using HTTPS, make sure admin isn’t forced to use secure URLs:
    UPDATE core_config_data SET value = 0 WHERE path = 'web/secure/use_in_adminhtml';
    

2. Flush All Magento Caches

Old cached URL settings are a common culprit here. Clear the cache manually via the command line:

# Delete cache directories
rm -rf var/cache/* var/page_cache/* var/generation/* var/view_preprocessed/* pub/static/adminhtml/*

# Or use Magento CLI if you have access
php bin/magento cache:flush
php bin/magento cache:clean

3. Check .htaccess Rewrite Rules

Custom or corrupted .htaccess rules can trigger redirect loops. Try renaming your root and pub directory .htaccess files to .htaccess.bak temporarily, then test accessing the admin. If it works, restore the original file and gradually remove any custom rules to find the problematic one.

Misconfigured cookies often cause redirect loops. Update these database settings:

  • Set the correct cookie domain:
    UPDATE core_config_data SET value = 'staging.manohar.com' WHERE path = 'web/cookie/cookie_domain';
    
  • Disable secure cookies since your site uses HTTP:
    UPDATE core_config_data SET value = 0 WHERE path = 'web/cookie/secure';
    

5. Validate Server Configuration

  • Apache: Ensure the mod_rewrite module is enabled, and your virtual host config has AllowOverride All so .htaccess rules are applied.
  • Nginx: Double-check your server block for any incorrect rewrite rules that might be forcing loops. Make sure the admin route (/admin) isn’t being redirected incorrectly.

If none of these steps work, check your server’s access and error logs— they’ll show the exact redirect chain, which can help pinpoint the root cause.

内容的提问来源于stack exchange,提问作者Manohar Prabhutendolkar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 10:24:42