Error - Redirect loop

Redirect loop

A redirection is a particular response from the server with a 3xx HTTP code informing the client (browser or robot) that the location of the page has changed. A redirection can also be a page change caused by HTML/JavaScript code. In both cases, a redirection leads users and robots to another URL and thus another page.

A redirect loop occurs when the different redirections tracked lead to a redirection already encountered. Example of redirection loops :

  • pageA > pageA
  • pageA > pageB > pageA
  • pageA > pageB > pageC > pageB

When a redirect loop occurs, you must intervene on your server/application and/or :

  • check that it is not a configuration or code error
  • change the destination of the first redirection to the final destination directly
  • break the loop by removing the first (or last) redirection and providing an HTML page instead
  • change the destination of the last redirection to a URL that has not already been met