Browser redirect loop detection

How do browsers (in general) detect a redirect loop? And how big a chain can they handle? It's easy to spot a two-way call forwarding cycle, but what about a 4 or 5 chain? - Is it just an array algorithm that will work on a chain of any length?

+6
source share
1 answer

This is even simpler: most browsers I have seen will simply stop after performing the maximum number of redirects. For example, if you have a rewrite rule that always appends an β€œx” to the end of the URL:

RewriteRule ^(.*) /$1x [R] 

Chrome will refuse until it reaches /xxxxxxxxxxxxxxxxxxxxx - 21 redirects total.

+9
source

Source: https://habr.com/ru/post/893733/


All Articles