When trying to access the OpenCart admin panel (/admin), you get:
- A browser error saying “ERR_TOO_MANY_REDIRECTS”.
- The page keeps refreshing and never loads.
- You cannot log in due to continuous redirects.
This issue often happens due to incorrect URL settings, session conflicts, or SSL misconfigurations.
1. Clear Browser Cookies & Cache
2. Check
config.phpFiles (Incorrect URLs)/admin/config.phpand/config.php.define('HTTP_SERVER', 'https://yourdomain.com/admin/');
define('HTTPS_SERVER', 'https://yourdomain.com/admin/');
HTTPS_SERVERis correct.3. Fix Cookie & Session Settings in
config.php/admin/config.php:ini_set('session.cookie_secure', 'On');
ini_set('session.use_only_cookies', 'On');
4. Manually Clear OpenCart Sessions
rm -rf system/storage/session/*
TRUNCATE TABLE oc_session;
5. Disable SSL Temporarily in the Database
UPDATE oc_setting SET value = '0' WHERE key = 'config_secure';
6. Check for
.htaccessRedirect Issues.htaccesshas incorrect rules, it can cause redirect loops..htaccesstemporarily and try again.7. Disable Admin Login Redirects via Database
UPDATE oc_setting SET value = '0' WHERE key = 'config_admin_language';
8. Restart the Web Server & Try Again
service apache2 restart # For Apache
service nginx restart # For Nginx
9. Restore from a Working Backup
config.php.Comments:
Incorrect settings or session conflicts usually cause this issue. If you’re still stuck, check the browser console for redirect errors. 🚀