3

Magento 2.1.2 PHP Version: 5.6.17 MySQL Version: 5.6.33

The store is completely set up, designed and in production mode. Braintree payment method is set up. Categories and products are created. Everything seems to work fine; except "Add to Cart" or checkout.

When I navigate to storefront as a guest and click "Add to Cart" to add the product to cart, it doesn't work-- It redirects to a blank page with the error below...

"The page isn’t redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete".

Additional information

I have tried it in all browsers and got the same error result

NOTE: It's a Magento multistore

Any had this issue before? And what could be causing this?

Thanks in advance!

  • Check issues on Magento GitHub account there is cart issues – Sylvain Rayé Oct 14 '16 at 19:42
1

I had this issue and it turned out to be ModSecurity detecting false positives.

I knew it was server-level as I could intentionally put a syntax error in the .htaccess file and yet the redirect loop was still occurring.

Over in WHM, Home » Security Center » ModSecurity™ Tools shows a Hit List. From here it's easy to see what's going on. In my case, rules 981245 and 981246 were being triggered by the mage-messages cookie (urldecoded for convenience)...

mage-messages=[{"type":"success","text":"You added Simple Test Product to your shopping cart."}]

Preg matching on the two rules gave:

Array
(
    [0] => Array
        (
            [0] => ":"success","t
            [1] => ":"You a
        )

)
Array
(
    [0] => Array
        (
            [0] => "type":"
            [1] => "text":"
        )
)

It looks specifically like ":" was the trigger.

Security Center » ModSecurity™ Tools » Rules List allows you to disable individual rules so this is what I did.

0

I have also seen similar situation when a redirect on the cpanel was done incorrectly causing an infinite loop.

Have you tweaked any settings in the .htaccess related to domains recently like trying to make samplesite.com forward to www.samplesite.com?

Also try turning off all caches, flush magento cache and then try turning the cache back on. Once you have turned on the cache again, try using the add to cart.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.