Set default redirect url
428536
protected function initialRedirectUrl() {

        $defaultUrl = '/'. $this->controller->id . '/' . $this->controller->defaultAction;

        if (isset($this->controller->module->id) && !$this->controller->module instanceof Application) {
            $defaultUrl = '/' . $this->controller->module->id . $defaultUrl;
        }

        if ( empty( $this->successUrl ) ) {
            $this->successUrl = $defaultUrl;
        }

        if ( empty( $this->failedUrl ) ) {
            $this->failedUrl = $defaultUrl;
        }

    }
247428
function redirect(url) {

      var ua = navigator.userAgent.toLowerCase(),
        isIE = ua.indexOf('msie') !== -1,
        version = parseInt(ua.substr(4, 2), 10);
        // Internet Explorer 8 and lower
        if (isIE && version < 9) {
          var link = document.createElement('a');
          link.href = url;
          document.body.appendChild(link);
          link.click();
        }
        // All other browsers can use the standard window.location.href (they don't lose HTTP_REFERER like Internet Explorer 8 & lower does)
        else {
          window.location.href = url;
      }
    }
636725
def get_default_redirect(self, rule, method, values, query_args):
        
        assert self.map.redirect_defaults
        for r in self.map._rules_by_endpoint[rule.endpoint]:
            # every rule that comes after this one, including ourself
            # has a lower priority for the defaults.  We order the ones
            # with the highest priority up for building.
            if r is rule:
                break
            if r.provides_defaults_for(rule) and r.suitable_for(values, method):
                values.update(r.defaults)
                domain_part, path = r.build(values)
                return self.make_redirect_url(path, query_args, domain_part=domain_part)
651336
def resource_redirect(id):
    '''
    
    '''
    resource = get_resource(id)
    return redirect(resource.url.strip()) if resource else abort(404)
1078122
function createRedirectDirectoryListener () {
  return function redirect (res) {
    if (this.hasTrailingSlash()) {
      this.error(404)
      return
    }

    // get original URL
    var originalUrl = parseUrl.original(this.req)

    // append trailing slash
    originalUrl.path = null
    originalUrl.pathname = collapseLeadingSlashes(originalUrl.pathname + '/')

    // reformat the URL
    var loc = encodeUrl(url.format(originalUrl))
    var doc = createHtmlDocument('Redirecting', 'Redirecting to <a href="' + escapeHtml(loc) + '">' +
      escapeHtml(loc) + '</a>')

    // send redirect response
    res.statusCode = 301
    res.setHeader('Content-Type', 'text/html; charset=UTF-8')
    res.setHeader('Content-Length', Buffer.byteLength(doc))
    res.setHeader('Content-Security-Policy', "default-src 'self'")
    res.setHeader('X-Content-Type-Options', 'nosniff')
    res.setHeader('Location', loc)
    res.end(doc)
  }
}
230540
def get(self, url, **kwargs):
        
        """

        kwargs.setdefault('allow_redirects', True)
        return self.request('GET', url, **kwargs)
297499
function createDefaultOptions(url) {

  var options = {
      referer                 : DEFAULT_REFERER,
      skipDuplicates          : DEFAULT_SKIP_DUPLICATES,
      maxConnections          : DEFAULT_NUMBER_OF_CONNECTIONS,
      rateLimits              : DEFAULT_RATE_LIMITS,
      externalDomains         : DEFAULT_CRAWL_EXTERNAL_DOMAINS,
      externalHosts           : DEFAULT_CRAWL_EXTERNAL_HOSTS,
      firstExternalLinkOnly   : DEFAULT_FIRST_EXTERNAL_LINK_ONLY,
      scripts                 : DEFAULT_CRAWL_SCRIPTS,
      links                   : DEFAULT_CRAWL_LINKS,
      linkTypes               : DEFAULT_LINKS_TYPES,
      images                  : DEFAULT_CRAWL_IMAGES,
      protocols               : DEFAULT_PROTOCOLS_TO_CRAWL,
      timeout                 : DEFAULT_TIME_OUT,
      retries                 : DEFAULT_RETRIES,
      retryTimeout            : DEFAULT_RETRY_TIMEOUT,
      depthLimit              : DEFAULT_DEPTH_LIMIT,
      followRedirect          : DEFAULT_FOLLOW_301,
      userAgent               : DEFAULT_USER_AGENT,
      domainBlackList         : domainBlackList,
      suffixBlackList         : suffixBlackList,
      retry400                : DEFAULT_RETRY_400,
      isExternal              : false,
      storeModuleName         : DEFAULT_STORE_MODULE,
      queueModuleName         : DEFAULT_QUEUE_MODULE,
      jar                     : DEFAULT_JAR

  };

  if (url) {
    options.url = url;
  }

  return options;

}
795838
protected function checkRedirect() {
		if (!empty($this->getConfig()['forceRedirectUrl'])) {
			$this->getSite()->setRedirectUrl("{$this->getConfig()['forceRedirectUrl']}");
			$this->getSite()->redirect();
		}
	}
1142023
public function setRedirectUrl($redirectUrl)
    {
        if (!empty($redirectUrl) && ctype_print($redirectUrl)) {
            $this->redirectUrl = trim($redirectUrl);
        }

        return $this;
    }
330520
def get_redirect_url(self, **kwargs):
        """"""
        provider_id = kwargs.get('provider', '')
        provider = self.get_provider(provider_id)
        if not provider:
            raise Http404('Unknown OAuth provider.')
        callback = self.get_callback_url(provider)
        params = self.get_additional_parameters(provider)
        return provider.get_redirect_url(self.request, callback=callback, parameters=params)
341919
function getRedirectTo(options, page) {
    if( typeof options === 'string' ) {
        options = {redirectTo: options};
    }
    options = options || {};
    page = page || 'root';
    return options.redirectTo || defaults[page];
}
363772
def get_redirect_url(self, request, callback, parameters=None):
        """"""
        args = self.get_redirect_args(request, callback=callback)
        additional = parameters or {}
        args.update(additional)
        params = urlencode(args)
        return '{0}?{1}'.format(self.authorization_url, params)
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();
    }
1265556
function redirect(url) {
  // unset headers
  const { res } = this;
  res
    .getHeaderNames()
    .filter(name => !name.match(/^access-control-|vary|x-amz-/i))
    .forEach(name => res.removeHeader(name));

  this.set("Location", url);

  // status
  if (!statuses.redirect[this.status]) this.status = 302;

  if (this.status === 302) {
    const redirect = new S3Error("Found", "Resource Found");
    redirect.description = "302 Moved Temporarily";
    this.body = redirect.toHTML();
    this.type = "text/html";
  } else {
    this.body = "";
    this.type = "";
  }
}
364959
public function setRedirect($redirect) {
        if (!is_bool($redirect)) throw new IllegalTypeException('Illegal type of parameter $redirect: '.gettype($redirect));

        $this->redirect = $redirect;
        return $this;
    }
1087528
public function setRedirectUrl($redirectUrl)
    {

        if (!$this->getUrlValidator()->isValid($redirectUrl)) {
            throw new InvalidArgumentException('URL provided is invalid');
        }

        $this->redirectUrl = $redirectUrl;
    }
1026492
def redirect(self, url, method=None, **kwargs):
        
        return self.nest(Redirect(url, method=method, **kwargs))