Redirect to the canonical URL
@param String $canonical
@return Void
189656
public function redirect($canonical) {
        if (!preg_match('~^[a-z]+://~', $canonical)) {
            $canonical = new Garp_Util_FullUrl($canonical);
        }
        $controller = $this->getActionController();
        $controller->getHelper('cache')->disable();
        $controller->getHelper('viewRenderer')->setNoRender(true);
        $controller->getHelper('layout')->disableLayout();
        $controller->getHelper('redirector')->gotoUrl((string)$canonical, array('code' => 301));
    }
1250523
public function routeHttp()
    {
        if ($this->config->isInitialized() || $this->url->isInstall()) {
            $this->route->process();
        } else {
            $this->url->redirect('install');
        }
    }
48834
private function redirect()
    {
        if ($this->config['sandbox']) {
            $this->endpoint_redirect = $this->sandbox_endpoint_redirect;
        }
        $key1 = $this->config['app_key1'];
        $key2 = $this->config['app_key2'];
        $param = array(
            'AuthCode' => $this->auth_code,
            'facId'    => $this->config['app_id'],
            'facMemId' => $this->parameter['userId'],
            'hash'     => hash('sha256',
                "{$key1}{$this->auth_code}{$this->config['app_id']}{$this->parameter['userId']}{$key2}")
        );
        $this->endpoint_redirect .= '?' . http_build_query($param);
        header('Location:' . $this->endpoint_redirect);
        exit();
    }
1145330
protected function registerRedirection(): void
    {
        if (! empty($this->redirectAfterInstalled) && \is_string($this->redirectAfterInstalled)) {
            Installation::$redirectAfterInstalled = $this->redirectAfterInstalled;
        }
    }
142213
private function _redirect($location)
	{
		$locationUrl = new Url($location);

		// if the location header was relative (bleh) add the host
		if(!$locationUrl->hasHost())
		{
			$locationUrl = $this->_url->getUrlForPath($location);
		}

		if($this->_redirects > self::MAX_REDIRECTS)
		{
			throw new Error\BadRequest("Exceeded maximum redirects");
		}

		$this->_redirects++;

		return $this->_dispatchRequest(
			new Request('GET', $locationUrl, $this->_headers));
	}
388734
def canonical(request, uploaded_at, file_id):
    
    filer_file = get_object_or_404(File, pk=file_id, is_public=True)
    if (uploaded_at != filer_file.uploaded_at.strftime('%s') or
            not filer_file.file):
        raise Http404('No %s matches the given query.' %
                      File._meta.object_name)
    return redirect(filer_file.url)
505819
public function redirectTo($location) {
        $app = $GLOBALS['app'];
        $host = $_SERVER['HTTP_HOST'];
        if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
            $host = $_SERVER['HTTP_X_FORWARDED_HOST'];
        }
        $protocol = isset($_SERVER['HTTPS'])?'https://':'http://'; 
        $redirectLocation = $protocol.$host.'/'.$app->getConfiguration()->getApplicationContext().'/'.$location;
        if ($app->getSubject()->isAuthenticated()) {
            $separator = '?';
            if(strpos($redirectLocation, '?'))
                $separator = '&';
            $redirectLocation .= $separator."rand_token=".urlencode($app->getSessionManager()->getActiveSession()->getAttribute('nonce'));
        }
        if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && 
            strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
                $this->addHeader("Content-type: application/json");
                $response = array();
                $response['redirect'] = $redirectLocation;
                echo json_encode($response);
                exit;
        } else {
            $this->addHeader('Location: '.$redirectLocation);
        }
    }
1001873
public static function Redirect($sUrl){
            $oThis = self::CreateInstanceIfNotExists();

            @header($oThis->aHTTPStatus[301]);
            @header("Location: ".$sUrl);
            die();
        }
902724
public function redirectTo($route = null)
    {
        if (is_null($route)) {
            $url = $this->di->request->getCurrentUrl();
        } else {
            $url = $this->di->url->create($route);
        }
        $this->di->response->redirect($url);
    }
790858
public function redirectToIntended($default = '/', $status = 302, $headers = [], $secure = null)
    {
        respondWith(response()->redirectToIntended($default, $status, $headers, $secure ));
    }
600615
public function redirect($url, $status = null)
    {
        $this->withHeader('Location', (string)$url);

        if (is_null($status) && $this->getStatusCode() === HttpMessage::HTTP_OK) {
            $status = 302;
        }
    }
1263372
public function redirect($url)
    {
        if (!$this->isValidUrl($url)) {
            $url = $this->generateUrl($url);
        }

        header('Location: '.$url);
    }
125680
public function redirectTo($path, $status = 302, $headers = [], $secure = null)
    {
        respondWith(response()->redirectTo($path, $status, $headers, $secure));
    }
192398
public function validate($canonical) {
        $currUrl = $this->getRequest()->getRequestUri();
        // match using a full url if the canonical starts with a protocol
        if (preg_match('~^[a-z]+://~', $canonical)) {
            $isObj = $canonical instanceof Garp_Util_FullUrl;
            $omitProtocol = $isObj ? $canonical->getOmitProtocol() : false;
            $omitBaseUrl = $isObj ? $canonical->getOmitBaseUrl() : false;
            $currUrl = new Garp_Util_FullUrl($currUrl, $omitProtocol, $omitBaseUrl);
        }
        return (string)$currUrl == (string)$canonical;
    }
456396
public function legacyRedirectForEditView($request)
    {
        $fileID = $request->param('FileID');
        /** @var File $file */
        $file = File::get()->byID($fileID);
        $link = $this->getFileEditLink($file) ?: $this->Link();
        $this->redirect($link);
    }
767184
protected function redirect(string $url, int $httpResponseCode = 302): void
    {
        header('Location: ' . $url, true, $httpResponseCode);
        exit;
    }
1192104
public function set_redirect_location($location) {
	if (self::$send_status_headers == false && base::$debug) {
		trigger_error('location will not be send out unless response::$send_status_headers is true', E_USER_NOTICE);
	}
	
	$this->redirect_location = $location;
}