I haven’t figured out how to redirect from the source to a URL query
I don’t really understand what you mean here. Can you explain it further?
Sorry if I wasn’t clear. I want to set up a dynamic target URL based on the query parameter “target” from the source URL (as the example above).
I will have hundreds of links that look like this:
example.com/recommended/?target=targetdomain.com/1
example.com/recommended/?target=targetdomain.com/2
example.com/recommended/?target=targetdomain.com/3
These three examples will be redirected to the corresponding targets:
targetdomain.com/1
targetdomain.com/2
targetdomain.com/3
I would love it if I didn’t have to set up each individual redirect, but merely redirect based on the “target” parameter, and that way only set up a single regex match redirect.
Hope this is more clear.
You can use a regular expression for this:
https://redirection.me/support/redirect-regular-expressions/
Be aware that what you have proposed is an open redirect. If you are not careful then people can use your site to redirect people to bad sites (example.com/recommended/?target=baddomain.com), which can be used for phishing.
You should make sure your expression only works for the specific target domains you allow.
THanks a bunch. Appreciate the added information you provided.
Have a great day John.