Redirect and retain query string


Hi, I am using Fastly to redirect a number of urls from one domain to another using the instructions here:

This is great except that I lose any querystring parameters which were in the original request. Is there any way that I can configure my redirects so that they retain the original querystring?



Hi Rupert,

I’ve whipped up a quick fiddle example of req.url being used in a response after the host that “brings through” the URL and query string parameter here:

Essentially you want the source field to say something like:
"" + req.url
(The + sign is optional)

If you want to modify the URL and state that in the location header and only bring the qs through there is req.url.qs. Feel free to clone my fiddle example and experiment.


Richard, you are a legend thank you!

Also I was completely unaware of the fiddle tool, that is super useful.