Edit page, modify page slug causes HTTP 404 on old page URL. TYPO3\CMS\Redirects\Service\SlugService::rebuildSlugsForSlugChange must force-rebuild redirects cache.
When editing a page and changing its slug, then saving the page record, then a new redirect is added by
However, the redirects cache is not cleared (
\TYPO3\CMS\Redirects\Service\RedirectCacheService::rebuild is not invoked), and the page whose slug was changed (requested via its old URI) consistently throws a HTTP 404 Not Found instead of redirecting to its new URI.
- Either the entire
'pages'cache is cleared, in which the redirects are serialized under the
- Or until a
sys_redirectsrecord is modified and saved, which invokes
Saving a page record with modified slug does not invoke
\TYPO3\CMS\Redirects\Service\SlugService::createRedirect does not use the
DataHandler to store the newly added
DataHandlerCacheFlushingHook only listens to
DataHandler commands involving
sys_redirect records being saved. This is not the case here.
\TYPO3\CMS\Redirects\Service\SlugService::createRedirect inserts the new record via the
\TYPO3\CMS\Redirects\Service\SlugService::rebuildSlugsForSlugChange just before
Updated by Felix Heller 2 months ago
I can confirm that this problem still exists in TYPO3 11.5.0. If a redirect entry is added, edited or deleted in the backend module "Redirects", the redirect cache is cleared, but if a redirect is created because a page's slug was changed, then the redirect cache remains unchanged.