Magento Community 1.9 HTTPS redirect loop with Cloudflare

Magento Community 1.9 HTTPS redirect loop with Cloudflare

September 5, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento Community 1.9 HTTPS redirect loop with Cloudflare

Solving Magento Community 1.9 HTTPS Redirect Loops with Cloudflare

As a senior developer specializing in e-commerce platforms like Magento, I’ve seen this issue arise frequently when migrating to secure environments using services like Cloudflare. The redirect loop you’re experiencing is quite common, but fortunately, there are several steps we can take to resolve it.

Understanding the Redirect Loop Issue

The root cause of your problem lies in how Magento handles its secure and non-secure URLs during HTTPS migration. When you enable SSL through Cloudflare’s flexible SSL feature or other means, Magento doesn’t always update its core configuration files correctly. This results in a mismatch between the URL paths and the secure/non-secure status, leading to an endless loop of redirects.

Step-by-Step Solution

  1. Validate Your Base URLs First, let’s ensure your base URLs are configured properly in Magento’s admin panel. Log into your Magento backend at https://admin.yourwebsite.com and navigate to Stores > Configuration > General > Web.

    Look for the following fields:

    • Base URL (Secure)
    • Base Link URL
    • Base Skin URL

    Ensure they all start with https://. If any are using http://, update them accordingly. Save your changes.

  2. Clear Magento Cache Even though you mentioned disabling cache management, it’s worth explicitly clearing the cache to ensure no lingering issues remain. In your Magento backend, go to System > Cache Management and click “Flush Cache Storage”.

  3. Update Your .htaccess File

    The .htaccess file is where many HTTPS configuration settings live in Magento. You can find this file at the root level of your Magento installation.

    Open it in a text editor like Sublime Text or Notepad++, and look for these lines:

    RewriteEngine On
    #RewriteRule .* - [E=HTTP_HOST:%{HTTP_HOST}]
    

    If the second line is commented out, uncomment it by removing the # symbol at the beginning.

    Save your changes and close the file.

  4. Update Your Cloudflare Page Rules

    While you’ve set up page rules correctly in your current configuration, let’s ensure they’re optimal for Magento 1.9:

    • Set a rule targeting https://yourwebsite.com/* with the following settings:

      • Cache everything: Off
      • Security Level: High (or lower if needed)
      • SSL Certificate: Flexible (if not already enabled)
    • Create another rule targeting https://yourwebsite.com/admin/* and set it to inherit from the above rule.

  5. Check Your Cloudflare Crypto Settings

    Go to the Crypto section in your Cloudflare dashboard for your domain. Ensure that “Always Use HTTPS” is activated under the SSL/TLS settings. This setting ensures all traffic is forced through the secure connection, which can help prevent mixed content errors.

Conclusion and Next Steps

Implementing these steps should resolve your Magento 1.9 redirect loop issue with Cloudflare’s flexible SSL. If you still encounter problems after following this guide, here are a few additional troubleshooting tips:

  • Double-check that there are no conflicting rules or settings between your .htaccess file and the Apache configuration on your server.
  • Review your Cloudflare settings once more to ensure there are no overlapping or contradictory rules.
  • If all else fails, consider using a Magento extension specifically designed for handling HTTPS migrations, such as this one from Laravel Company.

Remember that migrating to HTTPS is an important step for improving your website’s security and SEO. With patience and careful configuration, you can successfully implement secure connections without disrupting your e-commerce operations.

If you have any further questions or encounter new issues after following this guide, don’t hesitate to reach out to our support team at Laravel Company. We’re always here to help ensure your Magento stores are operating at peak performance.

Magento 1 Cache Themes Admin

Our network