Issue Bug Closed

#96427Redirects module generates endless redirect loop ("Too many redirects") when renaming slug back and forth

Jörn Wagner 12/22/21, 19:26 updated 10/04/22, 14:14

Description

In TYPO3 10.4.22 (but also ever since I’ve used the redirects module) there is a bug when you enable autoCreateRedirects and rename slugs back and forth.

Steps to reproduce:
  1. Install TYPO3 v10 from scratch
  2. Add redirects: composer req typo3/cms-redirects ^10.4
  3. Create a homepage and site configuration
  4. Add the following to your site configuration config.yml:
settings:
redirects:
autoCreateRedirects: true
  1. Create a page below the homepage and give it the slug “demo”. Save.
  2. Change the slug to “demo2”, a redirect will be created.
  3. Change the slug back to “demo” and the first redirect will now be a circular reference.

This is the resulting situation in the backend:
clipboard-202112222026-koo38.png

The culprit is the fact that as target there is not a URL defined but a Typolink of the form t3://page?uid=2&_language=0. This means that the “old” slug will always redirect to whatever the current slug is … but it is the same after these operations, resulting in a “Too many redirects” error in the browser.

The entries in sys_redirects look like this with the first line being the problematic one:
typo3_redirects_bug.png

Reviews 3