question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option to choose the query parameter used for redirects

See original GitHub issue

When executing a filter rule, in the case when a request URL has multiple query parameters that are valid URLs, RequestControl currently picks the first one as the URL to redirect to. I’d like to have a way to specify that a particular named parameter is the one to use.

For example, the outbound links on vulture.com articles (example), when clicked, take you through a go.redirectingat.com URL that includes an sref parameter which contains the URL of the article you’re coming from, as well as a url parameter that contains the URL I’d like to be able to redirect to. But since sref precedes url, a filter redirect would just dump me back to where I came from.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
tumpiocommented, Jul 30, 2018

These should work too:

  1. Allow search parameters in redirect rule substitutions ({search.url} or some other syntax)
  2. Trimming unwanted parameters before choosing a filter redirect

Improvements are always welcome! 😃

1reaction
rhendriccommented, Jun 21, 2018

It seems a shame to make people write a manual regex parser like {search/.*[?&]url=([^&]*).*/decodeURIComponent($1)} instead of {search.url}. The URL class already parses search parameters into a Map called searchParams; it would be easy for you to parse {search.whatever} into a redirect pattern that resolves requestURL.searchParams.get('whatever'). Why ask users to do that work with regexes?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Query Parameters With Redirects - AIOSEO
With the Redirection Manager in All in One SEO, you can choose how you redirect both URLs above (the one with and without...
Read more >
URL Redirect with Parameters - Domains - Namecheap.com
You can use URL Redirect to forward your visitors to a specific page at the destination URL and pass values via query strings...
Read more >
Matching a URL - Redirection.me
At the heart of Redirection is the ability to match a URL and then do something. A URL looks like this: http://example.com/path/to/something?query=param.
Read more >
Pass url params in rewrites and redirects · Issue #97 - GitHub
i.e. /test to another domain i.e. https://example.com/test . The redirect works as expected, but if I try to add some url parameters, /test?...
Read more >
Query Params Rule Documentation - Requestly
Select Query Param Rule​​ Since Requestly supports multiple rule types, when you click on Add Icon, it takes you to Rule Type selection...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found