serve-handler icon indicating copy to clipboard operation
serve-handler copied to clipboard

How to keep utm parameters in redirects?

Open KevinDanikowski opened this issue 3 years ago • 2 comments

I have redirects I'd like to implement, but I'm not seeing a way to keep them from stripping the query parameters. Is there anyways I can keep utm_val=something in my config?

{ 
  "redirects": [ 
    {
      "source": "/oldpath?utm_val=something",
      "destination": "/newpath"
    } 
  ]
}

Desired Behavior:

/oldpath?utm_val=something => /newpath?utm_val=something

Current Behavior:

/oldpath?utm_val=something => /newpath

KevinDanikowski avatar Jun 14 '21 13:06 KevinDanikowski

After looking into it, currently this package doesn't support this ability. I have added the ability and created a PR for it.

PS: For anyone interested, I made this change and published @kevindanikowski/serve-handler 6.2.0 and @kevindanikowski/serve 12.0.0 with the updated dependency.

KevinDanikowski avatar Jun 14 '21 15:06 KevinDanikowski

shameless self-promotion alert:
this feature is available in my @warren-bank/serve fork of serve

warren-bank avatar Feb 16 '22 00:02 warren-bank