---
title: "Feature: #106363 - PSR-14 event for modifying URLs in redirects:checkintegrity"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:feature-106363-1742136433"
source: "Changelog/14.0/Feature-106363-ModifyPagesForIntegrityCheck.rst"
typo3-version: "14.0"
typo3-major: 14
type: "feature"
issue: 106363
forge: "https://forge.typo3.org/issues/106363"
tags: ["PHP-API", "ext:redirects"]
rendered: "2026-09-28T19:48:07+00:00"
---

# Feature: #106363 - PSR-14 event for modifying URLs in redirects:checkintegrity {#feature-106363-1742136433}

See [forge#106363](https://forge.typo3.org/issues/106363)

## Description {#description}

A new PSR-14 event
`\TYPO3\CMS\Redirects\Event\AfterPageUrlsForSiteForRedirectIntegrityHaveBeenCollectedEvent`
has been introduced. It allows extensions to register event listeners to modify
the list of URLs processed by the CLI command
[redirects:checkintegrity](https://docs.typo3.org/c/typo3/cms-redirects/main/en-us/Setup/Index.html#redirects-checkintegrity).

## Example {#example}

The following example shows an event listener that uses the PHP attribute
`#[AsEventListener]` to register itself and adds the URLs found in a site's
XML sitemap to the list of URLs checked by the redirects integrity command.

**EXT:my_extension/Classes/EventListener/MyEventListener.php**

```php
use TYPO3\CMS\Core\Attribute\AsEventListener;
use TYPO3\CMS\Core\Http\RequestFactory;
use TYPO3\CMS\Redirects\Event\AfterPageUrlsForSiteForRedirectIntegrityHaveBeenCollectedEvent;

final readonly class MyEventListener
{
    public function __construct(
        private RequestFactory $requestFactory,
    ) {}

    #[AsEventListener]
    public function __invoke(AfterPageUrlsForSiteForRedirectIntegrityHaveBeenCollectedEvent $event): void
    {
        $pageUrls = $event->getPageUrls();

        $additionalOptions = [
            'headers' => ['Cache-Control' => 'no-cache'],
            'allow_redirects' => false,
        ];

        $site = $event->getSite();

        foreach ($site->getLanguages() as $siteLanguage) {
            $sitemapIndexUrl = rtrim((string)$siteLanguage->getBase(), '/') . '/sitemap.xml';
            $response = $this->requestFactory->request(
                $sitemapIndexUrl,
                'GET',
                $additionalOptions,
            );
            $sitemapIndex = simplexml_load_string($response->getBody()->getContents());

            foreach ($sitemapIndex as $sitemap) {
                $sitemapUrl = (string)$sitemap->loc;
                $response = $this->requestFactory->request(
                    $sitemapUrl,
                    'GET',
                    $additionalOptions,
                );
                $sitemap = simplexml_load_string($response->getBody()->getContents());
                foreach ($sitemap as $url) {
                    $pageUrls[] = (string)$url->loc;
                }
            }
        }

        $event->setPageUrls($pageUrls);
    }
}
```
