#96427Redirects module generates endless redirect loop ("Too many redirects") when renaming slug back and forth
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.
- Install TYPO3 v10 from scratch
- Add redirects:
composer req typo3/cms-redirects ^10.4 - Create a homepage and site configuration
- Add the following to your site configuration
config.yml:
settings:
redirects:
autoCreateRedirects: true
- Create a page below the homepage and give it the slug “demo”. Save.
- Change the slug to “demo2”, a redirect will be created.
- 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