Configuration
Extension configuration
Admin Tools > Settings > Extension Configuration > extendredirect
-
- Type
- options
- Default
- request
request: follow the redirect through TYPO3's frontend in the same PHP process, like a visitor would see it.database: resolve against thepages/sys_tables without any request.redirect Note
requestmode runs inside TYPO3, not over the network. The site does not have to be reachable over HTTP from the server, and Basic Auth, IP restrictions, a firewall or a CDN in front of it are not involved and need no configuration. This holds for the Scheduler and the command too: they run the same code and do not call the public URL. It needs a correct site base (Site Configuration > Base), because that is how the extension finds the site of a redirect. Redirects or rewrites defined in the web server configuration (outside TYPO3) are not seen.databasemode needs neither.
Email notification
When a redirect is disabled - by the health check (on save or via the command) or by the page delete/hide
protection - a mail can be sent. It is off by default and uses TYPO3's mail configuration
($GLOBALS); the sender is the default mail sender.
-
- Type
- boolean
- Default
- 0
Notify when a redirect is disabled. Switches the mail and the webhook (see below).
-
- Type
- string
Comma or semicolon separated list of addresses. Invalid addresses are ignored; without a valid address nothing is sent.
-
- Type
- options
- Default
- digest
digest: one mail with every redirect disabled during one check, command run or page change.single: one mail per redirect, sent immediately.
-
- Type
- options
- Default
- en
Language of the mail:
enorde.
Webhook
Instead of or in addition to the mail, the same notification can be posted as JSON to a webhook. It
needs notify and follows notify (one call per run or per redirect).
-
- Type
- string
http(s) URL that receives the JSON
POST. Empty = no webhook. Calls time out after 5 seconds. Only administrators can set it, and it is not validated beyond the scheme: do not point it at internal services you do not control.If the endpoint is behind Basic Auth, put the credentials in the URL (
https://): they are sent as anuser: password@host/ path Authorizationheader and masked as***in error messages. The URL is saved with the extension configuration, so a password in it ends up inconfig/. To keep it out of there, set it insystem/ settings. php config/, for example from an environment variable:system/ additional. php $GLOBALS['TYPO3_ CONF_ VARS'] ['EXTENSIONS'] ['extendredirect'] ['notify Webhook Url'] = getenv ('REDIRECT_ WEBHOOK_ URL');
-
- Type
- options
- Default
- text
text:{"text": "..."}, understood by Slack, Mattermost and Rocket.Chat incoming webhooks.json: a structured payload withevent(redirects_),disabled site,countand a listredirectsofredirect_,uid source_,host source_,path target,status_,code reason.
PSR-14 event
Independent of all notification settings, the Nivek1110Extendredirect
is dispatched for every redirect that was disabled and logged (by the health check or the page
delete/hide protection). The redirect is already disabled when listeners run.
use Nivek1110\Extendredirect\Event\RedirectDisabledEvent;
use TYPO3\CMS\Core\Attribute\AsEventListener;
#[AsEventListener]
final class MyListener
{
public function __invoke(RedirectDisabledEvent $event): void
{
// getRedirectUid(), getSourceHost(), getSourcePath(), getTarget(),
// getStatusCode(), getReason(), getEntry()
}
}
Note
Mail transport and webhook call run after the response: under PHP-FPM the request of the editor is finished
first (fastcgi_), so a slow SMTP server or endpoint never keeps the editor waiting. In the CLI
(command, Scheduler) they are sent at once; without PHP-FPM the request still waits.
Note
Nothing is sent by --. A failing mail transport is only logged and never breaks a save, a
check or a page deletion.