Use the bare minimum to redirect to legacy page

 Don't use query string of legacy urlname.
 This drops the given query string.
497609
def legacy_page_redirect_url
      page = last_legacy_url.page
      return unless page

      alchemy.show_page_path(
        locale: prefix_locale? ? page.language_code : nil,
        urlname: page.urlname
      )
    end
517032
def strip_querystring(url):
    """"""
    p = six.moves.urllib.parse.urlparse(url)
    return p.scheme + "://" + p.netloc + p.path
1026492
def redirect(self, url, method=None, **kwargs):
        
        return self.nest(Redirect(url, method=method, **kwargs))
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
618151
def validate_redirect_uri(value):
    
    sch, netloc, path, par, query, fra = urlparse(value)
    if not (sch and netloc):
        raise InvalidRedirectURIError()
    if sch != 'https':
        if ':' in netloc:
            netloc, port = netloc.split(':', 1)
        if not (netloc in ('localhost', '127.0.0.1') and sch == 'http'):
            raise InsecureTransportError()
132816
def preserve_builtin_query_params(url, request=None):
    
    if request is None:
        return url

    overrides = [
        api_settings.URL_FORMAT_OVERRIDE,
    ]

    for param in overrides:
        if param and (param in request.GET):
            value = request.GET[param]
            url = replace_query_param(url, param, value)

    return url
110046
public static function redirectToReferrer()
    {
        $referrer = self::getReferrer();
        if ($referrer !== false) {
            self::redirectToUrl($referrer);
        }
        self::redirectToUrl(self::getCurrentUrlWithoutQueryString());
    }
571058
def clean_url(url)
      uri = URI.parse(url)
      uri.query = CGI.parse(uri.query || '').reject { |k| k == 'api_key' }.to_query
      uri.to_s
    end
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)
9535
private String getRedirectUrl(HttpServletRequest request, String newScheme) {
    String serverName = request.getServerName();
    String uri = request.getRequestURI();

    StringBuilder redirect = new StringBuilder(100);
    redirect.append(newScheme);
    redirect.append("://");
    redirect.append(serverName);
    redirect.append(uri);

    String query = request.getQueryString();
    if (query != null) {
      redirect.append('?');
      redirect.append(query);
    }

    return redirect.toString();
  }
911680
def redirect_url=(redirect_url)

      if !redirect_url.nil? && redirect_url.to_s.length > 800
        fail ArgumentError, "invalid value for 'redirect_url', the character length must be smaller than or equal to 800."
      end

      @redirect_url = redirect_url
    end
771858
def get_redirect(paths):
    

    if isinstance(paths, str):
        paths = [paths]

    for path in paths:
        url, permanent = get_alias(path)
        if url:
            return redirect(url, 301 if permanent else 302)

        url, permanent = current_app.get_path_regex(path)
        if url:
            return redirect(url, 301 if permanent else 302)

    return None
612884
function skip(ignoreRouteUrls) {
    return function ignoreUrl(req) {
        const url = req.originalUrl || req.url;
        return ignoreRouteUrls.includes(url);
    };
}
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;
    }
1295676
def lazy_raise_or_redirect():
    '''
    
    '''
    if not request.view_args:
        return
    for name, value in request.view_args.items():
        if isinstance(value, NotFound):
            request.routing_exception = value
            break
        elif isinstance(value, LazyRedirect):
            new_args = request.view_args
            new_args[name] = value.arg
            new_url = url_for(request.endpoint, **new_args)
            return redirect(new_url)
693859
def _legacy_request(self, method, table, **kwargs):
        

        warnings.warn("`%s` is deprecated and will be removed in a future release. "
                      "Please use `resource()` instead." % inspect.stack()[1][3], DeprecationWarning)

        return LegacyRequest(method,
                             table,
                             request_params=self.request_params,
                             raise_on_empty=self.raise_on_empty,
                             session=self.session,
                             instance=self.instance,
                             base_url=self.base_url,
                             **kwargs)
917363
function redirect(url) {
    var path = u.urlPath(url);
    var params = u.urlParams(url);

    var pg = generator.aliase$[path];
    if (pg) return { status:301, url:pg._href + params };

    pg = generator.redirect$[path];
    if (pg) return { status:302, url:pg._href + params };

    // customRedirects return params also
    pg = generator.customRedirect && generator.customRedirect(url);
    if (pg) return { status:301, url:pg };
  }