Redirect
Class \Bitrix\Main\Engine\Response\Redirect
.
To execute redirect, it's sufficient to use Response\Redirect. Kernel automatically performs necessary security checks and executes redirect 301 or 302 for.
//redirect with 302 status. $response = new \Bitrix\Main\Engine\Response\Redirect('/auth');
//redirect with 301 status. $response = new \Bitrix\Main\Engine\Response\Redirect('/auth'); $response->setStatus('301 Moved Permanently');
Method | Description | Available from version |
---|---|---|
__construct( $url, bool $skipSecurity = false ) | Constructor method. Parameters:
| |
getUrl( ) | Returns URL for redirect. | |
setUrl( $url) | Sets URL for redirect. Parameters:
| |
isSkippedSecurity(): bool | Returns current skipped security checks status during redirect. | |
setSkipSecurity( bool $skipSecurity ) | Sets security status checks. Parameters:
|
© «Bitrix24», 2001-2024