Magento 1.9 - too many redirects

Magento 1.9 - too many redirects

July 27, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento 1.9 - too many redirects

Magento 1.9: Resolving “Too Many Redirects” Error

If you’re facing a “too many redirects” error after changing your base URL in Magento 1.9, you’ve likely encountered a common issue that can be quickly resolved with the right steps.

Understanding the Issue

When you change the base_url under Configuration -> Web -> Unsecure, Magento stores this information in two database fields: core_config_data’s config/web/unsecure/base_url and core_config_data’s config/webs/secure/base_url. If these aren’t updated properly or if there are discrepancies between the secure and unsecure URLs, Magento enters a redirect loop that results in the “too many redirects” error.

Step-by-Step Resolution

1. Update the Database Fields Manually

The first step is to update these database fields directly through phpMyAdmin or any other SQL client.

UPDATE core_config_data SET value = 'http://example.com' WHERE path = 'config/webs/secure/base_url';
UPDATE core_config_data SET value = 'http://example.com' WHERE path = 'config/web/unsecure/base_url';

Ensure that you’re using the correct protocol (HTTP or HTTPS) for both secure and unsecure URLs. In this case, we’re assuming HTTP is required.

2. Clear Magento Caches

After updating the database, clear all Magento caches to ensure the changes take effect immediately:

rm -rf var/cache/*
rm -rf var/sessions/*

3. Verify .htaccess File

Check your .htaccess file in the root directory of your Magento installation. Ensure it contains the following lines (replace http://example.com with your actual URL):

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]

The first rule handles non-www and www redirection, while the second rule forces all traffic to redirect to HTTPS if necessary.

Additional Troubleshooting

If you’re still facing issues after following these steps, consider the following:

  • Ensure that your domain is properly configured with your hosting provider’s control panel.
  • Check for any custom redirection rules in your Magento configuration or in third-party extensions.
  • Verify that your SSL certificate (if using HTTPS) is correctly installed and valid.

Getting Professional Help

If you’re still unable to resolve the issue, consider reaching out to a professional Magento development agency. At Laravel Company, our team of experienced developers specializes in troubleshooting complex configuration issues like these.

We can help optimize your site’s performance, ensure secure URLs are configured correctly, and provide expert guidance on any other Magento-related challenges you might be facing. Feel free to contact us for a consultation or quote.

Conclusion

Resolving the “too many redirects” error in Magento 1.9 requires a systematic approach involving direct database updates, cache clearing, and careful verification of your configuration files. By following the steps outlined above, you should be able to quickly fix this issue and restore normal functionality to your site.

Remember, it’s always crucial to backup your database before making any significant changes, as incorrect updates can sometimes lead to data loss or corruption. If you’re unsure about any aspect of the process, don’t hesitate to consult a professional developer for guidance.

Happy coding!

Magento 1 Cache Database Admin

Our network