Issue Bug Closed

#103806Renaming a page slug generates duplicate redirects

Albrecht Köhnlein 05/08/24, 13:15 updated 07/09/24, 15:35

Description

If a default page suffix like “/” is configured in the Site configuration.

redirects.png

This is caused by the folling process:

  • The event listener TYPO3\CMS\Redirects\EventListener\AddPlainSlugReplacementSource generates a source by simply concatenating the base URL and the old slug slug, e.g. https://example.org/old-page-path
  • After that, a second source is generated by TYPO3\CMS\Redirects\EventListener\AddPageTypeZeroSource. Inside this class, the source is generated with TYPO3’s routing and respects the page suffix. This results in https://example.org/old-page-path/
  • If both sources would be the same, the first one would be skipped. But because the are different, both are kept for further processing
  • As last step, a redirect for each source is created, which leads to the result from the screenshot

Reviews 2