Performs a redirection
332737
protected function redirect()
    {
        $GLOBALS['eZRedirection'] = true;
        $ini = eZINI::instance();
        $automaticRedirect = true;

        if ( $GLOBALS['eZDebugAllowed'] && ( $redirUri = $ini->variable( 'DebugSettings', 'DebugRedirection' ) ) !== 'disabled' )
        {
            if ( $redirUri == "enabled" )
            {
                $automaticRedirect = false;
            }
            else
            {
                $uri = eZURI::instance( eZSys::requestURI() );
                $uri->toBeginning();
                foreach ( $ini->variableArray( "DebugSettings", "DebugRedirection" ) as $redirUri )
                {
                    $redirUri = new eZURI( $redirUri );
                    if ( $redirUri->matchBase( $uri ) )
                    {
                        $automaticRedirect = false;
                        break;
                    }
                }
            }
        }

        $redirectURI = eZSys::indexDir();

        $moduleRedirectUri = $this->module->redirectURI();
        if ( $ini->variable( 'URLTranslator', 'Translation' ) === 'enabled' &&
                eZURLAliasML::urlTranslationEnabledByUri( new eZURI( $moduleRedirectUri ) ) )
        {
            $translatedModuleRedirectUri = $moduleRedirectUri;
            if ( eZURLAliasML::translate( $translatedModuleRedirectUri, true ) )
            {
                $moduleRedirectUri = $translatedModuleRedirectUri;
                if ( strlen( $moduleRedirectUri ) > 0 && $moduleRedirectUri[0] !== '/' )
                    $moduleRedirectUri = '/' . $moduleRedirectUri;
            }
        }

        if ( preg_match( '#^(\w+:)|^//#', $moduleRedirectUri ) )
        {
            $redirectURI = $moduleRedirectUri;
        }
        else
        {
            $leftSlash = strlen( $redirectURI ) > 0 && $redirectURI[strlen( $redirectURI ) - 1] === '/';
            $rightSlash = strlen( $moduleRedirectUri ) > 0 && $moduleRedirectUri[0] === '/';

            if ( !$leftSlash && !$rightSlash ) // Both are without a slash, so add one
                $moduleRedirectUri = '/' . $moduleRedirectUri;
            else if ( $leftSlash && $rightSlash ) // Both are with a slash, so we remove one
                $moduleRedirectUri = substr( $moduleRedirectUri, 1 );

            // In some cases $moduleRedirectUri can already contain $redirectURI (including the siteaccess).
            if ( !empty( $redirectURI ) && strpos( $moduleRedirectUri, $redirectURI ) === 0 )
            {
                $redirectURI = $moduleRedirectUri;
            }
            else
            {
                $redirectURI .= $moduleRedirectUri;
            }
        }

        // After the module redirect url is completed, add the queryString params so they carry over the redirect operation
        $redirectURI .= eZSys::queryString();

        if ( $ini->variable( 'ContentSettings', 'StaticCache' ) == 'enabled' )
        {
            $staticCacheHandlerClassName = $ini->variable( 'ContentSettings', 'StaticCacheHandler' );
            $staticCacheHandlerClassName::executeActions();
        }

        eZDB::checkTransactionCounter();

        if ( !$automaticRedirect )
        {
            // Make sure any errors or warnings are reported
            if ( $ini->variable( 'DebugSettings', 'DisplayDebugWarnings' ) === 'enabled' )
            {
                if ( isset( $GLOBALS['eZDebugError'] ) && $GLOBALS['eZDebugError'] )
                {
                    eZAppendWarningItem(
                        array(
                            'error' => array(
                                'type' => 'error',
                                'number' => 1,
                                'count' => $GLOBALS['eZDebugErrorCount']
                            ),
                            'identifier' => 'ezdebug-first-error',
                            'text' => ezpI18n::tr( 'index.php', 'Some errors occurred, see debug for more information.' )
                        )
                    );
                }

                if ( isset( $GLOBALS['eZDebugWarning'] ) && $GLOBALS['eZDebugWarning'] )
                {
                    eZAppendWarningItem(
                        array(
                            'error' => array(
                                'type' => 'warning',
                                'number' => 1,
                                'count' => $GLOBALS['eZDebugWarningCount']
                            ),
                            'identifier' => 'ezdebug-first-warning',
                            'text' => ezpI18n::tr( 'index.php', 'Some general warnings occured, see debug for more information.' )
                        )
                    );
                }
            }

            $tpl = eZTemplate::factory();
            $tpl->setVariable( 'site', $this->site );
            $tpl->setVariable( 'warning_list', !empty( $this->warningList ) ? $this->warningList : false );
            $tpl->setVariable( 'redirect_uri', eZURI::encodeURL( $redirectURI ) );
            $templateResult = $tpl->fetch( 'design:redirect.tpl' );

            eZDebug::addTimingPoint( "Script end" );

            eZDisplayResult( $templateResult );
            eZExecution::cleanExit();
        }

        return eZHTTPTool::redirect( $redirectURI, array(), $this->module->redirectStatus(), true, true );
    }
994975
public void redirectCall(String connId, String destination) throws WorkspaceApiException {
        this.redirectCall(connId, destination, null, null);
    }
1342166
public static function Redirect($page, $arg1 = null, $arg2 = null, $arg3 = null, $arg4 = null, $arg5 = null)
    {
        if (self::$app instanceof WebApplication) {
            self::$app->getResponse()->Redirect($page, $arg1, $arg2, $arg3, $arg4, $arg5);
        }
    }
882192
public function redirect($path, $query = [], $http_response_code = 302) {
		$url = $this->create($path, $query, true, '&');
		header('Location: '.$url, true, $http_response_code);
		die('');
	}
884573
function httpRedirect (url, code) {
    // default to 302 redirect code
    if (!code) {
        code = 302
    }
    // create new error
    var err = new Error('Redirect')
    err.code = code
    err.url = url
    // throw error which will be handled by application framework
    throw err
}
1332929
def redirect(url, code=None):
    
    if not code:
        code = 303 if request.get('SERVER_PROTOCOL') == "HTTP/1.1" else 302
    res = response.copy(cls=HTTPResponse)
    res.status = code
    res.body = ""
    res.set_header('Location', urljoin(request.url, url))
    raise res
848935
public function redirect()
    {
        if (!$this->app->utilities->page->is('search')) {
            return;
        }

        if (!$this->searchQuery()) {
            return;
        }

        global $wp_rewrite;

        if (!$wp_rewrite->using_permalinks()) {
            return;
        }

        \wp_redirect(\get_search_link(), 301);

        exit;
    }
769405
public static function redirect($url, $status = 302, $headers = array())
    {
        $redirect = new RedirectResponse($url, $status, $headers);
        $redirect->sendHeaders();
        die();
    }
495018
function redirectFocus () {
    ctrl.styleTabItemFocus = ($mdInteraction.getLastInteractionType() === 'keyboard');
    var tabToFocus = getElements().tabs[ctrl.focusIndex];
    if (tabToFocus) {
      tabToFocus.focus();
    }
  }
1307864
protected function redirectByAction()
    {
        $params = $this->request->getArguments();
        $formAction = $params["formAction"];
        $arguments = array();
        if ($params["storage"]["type"] == "pages") {
            $arguments["layoutIdentifier"] = $this->backendLayoutRepository->findByIdentifier($params["storage"]["elements"]["key"],
                explode(",", $this->extSettings['backendlayout_pids']))->getIdentifier();
        } else {
            $arguments["key"] = $params["storage"]["elements"]["key"];
            $arguments["type"] = $params["storage"]["type"];
        }
        if (key_exists("save", $formAction)) {
            $this->redirect('edit', null, null, $arguments);
        } else {
            if (key_exists("saveAndExit", $formAction)) {
                $this->redirect('list');
            }
        }
    }
579292
public function handleRedirect(RedirectEvent $event)
    {
        /** @var Controller $controllerAdapter */
        $controllerAdapter = $this->framework->getAdapter(Controller::class);

        $controllerAdapter->redirect($event->getNewLocation(), $event->getStatusCode());
    }
760982
private void handleRequestRedirect(
            final CrawlCandidate currentCrawlCandidate,
            final String redirectedUrl) {
        CrawlRequestBuilder builder = new CrawlRequestBuilder(redirectedUrl)
                .setPriority(currentCrawlCandidate.getPriority());
        currentCrawlCandidate.getMetadata().ifPresent(builder::setMetadata);
        CrawlRequest redirectedRequest = builder.build();

        crawlFrontier.feedRequest(redirectedRequest, false);
        callbackManager.call(CrawlEvent.REQUEST_REDIRECT,
                new RequestRedirectEvent(currentCrawlCandidate, redirectedRequest));
    }
1216239
public function redirectByUrl($defaultRedirect = null, $key = null) {
		$redirectUrl = $this->getRedirectUrl($defaultRedirect, $key);

		return $this->_controller->redirect($redirectUrl);
	}
1067914
function redirect($to) {

    if ($this->performed) {
      throw new Trails_DoubleRenderError();
    }

    $this->performed = TRUE;

    # get uri; keep absolute URIs
    $url = preg_match('#^(/|\w+://)#', $to)
           ? $to
           : $this->url_for($to);

    $this->response->add_header('Location', $url)->set_status(302);
  }
79154
static function Redirect301($target, $noExit = false)
    {
        self::Redirect($target, self::REDIRECT_HEADER_301, $noExit);
    }
1371536
protected function _handleRedirect($type, $options) {
		if (isset($options[$type . 'RedirectUrl']) && $options[$type . 'RedirectUrl'] !== false) {
			$controller = $this->getController();
			$result = $controller->redirect($options[$type . 'RedirectUrl']);
			$this->_redirectResponse = $result;

			return $result;
		}

		$this->_redirectResponse = null;

		return false;
	}
651336
def resource_redirect(id):
    '''
    
    '''
    resource = get_resource(id)
    return redirect(resource.url.strip()) if resource else abort(404)