We recently enabled Cloudflare’s proxy and Robot Fight Mode on our primary domain, using a free account, but now we’re having problems with links containing UTM codes in the query string.
It appears that Cloudflare is rearranging the variables in query strings so they’re in alphabetical order. But if there are any UTM codes in the string, and it isn’t already in alphabetical order, then Cloudflare gets stuck in a redirect loop and the browser throws a ERR_TOO_MANY_REDIRECTS error. They don’t even need to be real UTM codes, as long as they start with utm_
, so utm_fake
can trigger the error.
As an example, this triggers the error:
https://californiasciencecenter.org/?utm_b=test1&utm_a=test2
…but this does not:
https://californiasciencecenter.org/?utm_a=test2&utm_b=test1
If I change the ‘m’ to ‘n’, like this:
https://californiasciencecenter.org/?utn_b=test1&utn_a=test2
…the page loads fine, but the query string is reorganized to this:
https://californiasciencecenter.org/?utn_a=test2&utn_b=test1
If I hit the same server using a subdomain that bypasses Cloudflare’s proxy, none of this happens and the page loads fine.
I’ve read all the other posts related to this error and none of them seem to apply. We’re not using any page rules, and our SSL/TLS encryption mode is Full.
When I use the Redirect Path extension in Chrome, this is what I see:
Status Code URL IP Page Type Redirect Type Redirect URL
301 https://californiasciencecenter.org/?utm_b=test1&utm_a=test2 2606:4700:3035::ac43:a1f6 server_redirect permanent https://californiasciencecenter.org/?utm_b=test1&utm_a=test2
301 https://californiasciencecenter.org/?utm_b=test1&utm_a=test2 2606:4700:3035::ac43:a1f6 server_redirect permanent https://californiasciencecenter.org/?utm_b=test1&utm_a=test2
301 https://californiasciencecenter.org/?utm_b=test1&utm_a=test2 2606:4700:3035::ac43:a1f6 server_redirect permanent https://californiasciencecenter.org/?utm_b=test1&utm_a=test2
301 https://californiasciencecenter.org/?utm_b=test1&utm_a=test2 2606:4700:3035::ac43:a1f6 server_redirect permanent https://californiasciencecenter.org/?utm_b=test1&utm_a=test2
301 https://californiasciencecenter.org/?utm_b=test1&utm_a=test2 2606:4700:3035::ac43:a1f6 server_redirect permanent https://californiasciencecenter.org/?utm_b=test1&utm_a=test2
301 https://californiasciencecenter.org/?utm_b=test1&utm_a=test2 2606:4700:3035::ac43:a1f6 server_redirect permanent https://californiasciencecenter.org/?utm_b=test1&utm_a=test2
301 https://californiasciencecenter.org/?utm_b=test1&utm_a=test2 2606:4700:3035::ac43:a1f6 server_redirect permanent https://californiasciencecenter.org/?utm_b=test1&utm_a=test2
301 https://californiasciencecenter.org/?utm_b=test1&utm_a=test2 2606:4700:3035::ac43:a1f6 server_redirect permanent https://californiasciencecenter.org/?utm_b=test1&utm_a=test2
301 https://californiasciencecenter.org/?utm_b=test1&utm_a=test2 2606:4700:3035::ac43:a1f6 server_redirect permanent https://californiasciencecenter.org/?utm_b=test1&utm_a=test2
301 https://californiasciencecenter.org/?utm_b=test1&utm_a=test2 2606:4700:3035::ac43:a1f6 server_redirect permanent https://californiasciencecenter.org/?utm_b=test1&utm_a=test2
301 https://californiasciencecenter.org/?utm_b=test1&utm_a=test2 2606:4700:3035::ac43:a1f6 server_redirect permanent https://californiasciencecenter.org/?utm_b=test1&utm_a=test2
301 https://californiasciencecenter.org/?utm_b=test1&utm_a=test2 2606:4700:3035::ac43:a1f6 server_redirect permanent https://californiasciencecenter.org/?utm_b=test1&utm_a=test2
301 https://californiasciencecenter.org/?utm_b=test1&utm_a=test2 2606:4700:3035::ac43:a1f6 server_redirect permanent https://californiasciencecenter.org/?utm_b=test1&utm_a=test2
301 https://californiasciencecenter.org/?utm_b=test1&utm_a=test2 2606:4700:3035::ac43:a1f6 server_redirect permanent https://californiasciencecenter.org/?utm_b=test1&utm_a=test2
301 https://californiasciencecenter.org/?utm_b=test1&utm_a=test2 2606:4700:3035::ac43:a1f6 server_redirect permanent https://californiasciencecenter.org/?utm_b=test1&utm_a=test2
301 https://californiasciencecenter.org/?utm_b=test1&utm_a=test2 2606:4700:3035::ac43:a1f6 server_redirect permanent https://californiasciencecenter.org/?utm_b=test1&utm_a=test2
301 https://californiasciencecenter.org/?utm_b=test1&utm_a=test2 2606:4700:3035::ac43:a1f6 server_redirect permanent https://californiasciencecenter.org/?utm_b=test1&utm_a=test2
301 https://californiasciencecenter.org/?utm_b=test1&utm_a=test2 2606:4700:3035::ac43:a1f6 server_redirect permanent https://californiasciencecenter.org/?utm_b=test1&utm_a=test2
301 https://californiasciencecenter.org/?utm_b=test1&utm_a=test2 2606:4700:3035::ac43:a1f6 server_redirect permanent https://californiasciencecenter.org/?utm_b=test1&utm_a=test2
301 https://californiasciencecenter.org/?utm_b=test1&utm_a=test2 2606:4700:3035::ac43:a1f6 server_redirect permanent https://californiasciencecenter.org/?utm_b=test1&utm_a=test2
If I change ‘m’ to ‘n’ again, then I get this path:
Status Code URL IP Page Type Redirect Type Redirect URL
301 https://californiasciencecenter.org/?utn_b=test1&utn_a=test2 2606:4700:3035::ac43:a1f6 server_redirect permanent https://californiasciencecenter.org/?utn_a=test2&utn_b=test1
200 https://californiasciencecenter.org/?utn_a=test2&utn_b=test1 2606:4700:3035::ac43:a1f6 normal none none
That appears to be a Cloudflare IP, so this is really looking like a bug in Cloudflare, but if anyone has any brilliant ideas, I’m game to try anything.