Использование:
[[Redirect? &id=`3` &responseCode=`307`]]
Где id - это ID ресурса куда отправить, а responseCode - код статуса редиректа в соответствии с HTTP/1.1 протоколом, подробнее: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
Код сниппета:
$id = $modx->getOption('id', $scriptProperties, $modx->getOption('site_start'));
$responseCode = $modx->getOption('responseCode', $scriptProperties, '301');
//Статус редиректа в соответствии с HTTP/1.1 протоколом, подробнее: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
switch ($responseCode) {
case '302': $redirectStatus = 'HTTP/1.1 302 Found';
break;
case '303': $redirectStatus = 'HTTP/1.1 303 See Other';
break;
case '307': $redirectStatus = 'HTTP/1.1 307 Temporary Redirect';
break;
default: $redirectStatus = 'HTTP/1.1 301 Moved Permanently';
}
$url = $modx->makeUrl($id);
$modx->sendRedirect($url,array('responseCode' => $redirectStatus));