$url = 'https://example.com/'; $status = 301; t3lib_div::locationHeaderUrl($url, $status);
$url = 'https://example.com/page'; $status = 302; t3lib_div::locationHeaderUrl($url, $status);
$url = 'https://example.com/'; t3lib_div::locationHeaderUrl($url);This code will redirect the user to the homepage of example.com without specifying a status code, which defaults to 302. The locationHeaderUrl() function is part of the t3lib_div utility class, which is included in the TYPO3 CMS core.