Bug #96427
closedRedirects module generates endless redirect loop ("Too many redirects") when renaming slug back and forth
100%
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:
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:
Files
Updated by Thomas Oliver Moll almost 3 years ago
Hi,
I observed this behavior right away, when we switched to v9 ... I never regarded it really as a bug, but it is a huge trap for novice users.
I have no good idea how one would resolve this...
... When a Redirect is autocreated , check if it points to a redirect, that points to itself... and then what .. disable both? Or just show a Warning to the user (most of my users would not see/understand this though)
Updated by Jörn Wagner almost 3 years ago
Thomas Oliver Moll wrote in #note-1:
Hi,
I observed this behavior right away, when we switched to v9 ... I never regarded it really as a bug, but it is a huge trap for novice users.
I have no good idea how one would resolve this...
... When a Redirect is autocreated , check if it points to a redirect, that points to itself... and then what .. disable both? Or just show a Warning to the user (most of my users would not see/understand this though)
I've also noticed it right away, that's why we always set autoCreateRedirects
to false
...
I think it could be solved in the RedirectService: If source and target are the same, don't issue a 301 or 307 redirect but just let the page load. Like, don't "match" if source and target are the same. This would not touch upon the redirect entry, which might be needed if the slug is changed again, but would prevent the "Too many redirects" error msg.
Updated by Gerrit Code Review almost 3 years ago
- Status changed from New to Under Review
Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72808
Updated by Gerrit Code Review almost 3 years ago
Patch set 2 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72808
Updated by Gerrit Code Review almost 3 years ago
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856
Updated by Gerrit Code Review almost 3 years ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856
Updated by Gerrit Code Review almost 3 years ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856
Updated by Gerrit Code Review almost 3 years ago
Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856
Updated by Gerrit Code Review almost 3 years ago
Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856
Updated by Gerrit Code Review almost 3 years ago
Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856
Updated by Gerrit Code Review almost 3 years ago
Patch set 3 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72808
Updated by Gerrit Code Review almost 3 years ago
Patch set 7 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856
Updated by Gerrit Code Review almost 3 years ago
Patch set 8 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856
Updated by Gerrit Code Review almost 3 years ago
Patch set 9 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856
Updated by Gerrit Code Review almost 3 years ago
Patch set 10 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856
Updated by Gerrit Code Review almost 3 years ago
Patch set 4 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72808
Updated by Gerrit Code Review almost 3 years ago
Patch set 11 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856
Updated by Gerrit Code Review almost 3 years ago
Patch set 12 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856
Updated by Gerrit Code Review almost 3 years ago
Patch set 5 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72808
Updated by Gerrit Code Review almost 3 years ago
Patch set 13 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856
Updated by Gerrit Code Review almost 3 years ago
Patch set 6 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72808
Updated by Gerrit Code Review almost 3 years ago
Patch set 14 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72856
Updated by Gerrit Code Review almost 3 years ago
Patch set 7 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72808
Updated by Gerrit Code Review almost 3 years ago
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72918
Updated by Gerrit Code Review almost 3 years ago
Patch set 2 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72918
Updated by Jörn Wagner almost 3 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset c911996629d17b86c1e97890bd56da400ec464d1.