'Refresh', '300' => 'Multiple Choices', '301' => 'Moved Permanently', '302' => 'Found', '303' => 'See Other', '304' => 'Not Modified', '305' => 'Use Proxy', '307' => 'Temporary Redirect' ); // Validate the method and default to 302 $method = isset($codes[$method]) ? (string) $method : '302'; if ($method === '300') { $uri = (array) $uri; $output = ''; // The first URI will be used for the Location header $uri = $uri[0]; } else { $output = '

'.html::anchor($uri).'

'; } // Run the redirect event Event::run('system.redirect', $uri); if (strpos($uri, '://') === FALSE) { // HTTP headers expect absolute URLs $uri = url::site($uri, request::protocol()); } if ($method === 'refresh') { header('Refresh: 0; url='.$uri); } else { header('HTTP/1.1 '.$method.' '.$codes[$method]); header('Location: '.$uri); } // We are about to exit, so run the send_headers event Event::run('system.send_headers'); exit('

'.$method.' - '.$codes[$method].'

'.$output); } } // End url