Redirect automatically loses subpath when using the default Vercel domain

Hi everyone, I’m currently using custom redirect in the Firewall section of the Vercel dashboard, but I’m running into an issue.

In my code, I’m using Vercel’s default domain with subpaths, for example:
.vercel.app/abc/def?ghi=...&klm=...

However, when the redirect happens, it automatically redirects to
subdomain?ghi=...&klm=..., and my subpath is lost.

Is there a way to configure this directly in the Vercel dashboard so that the redirect preserves the subpaths?

Thank you everyone.

The firewall redirects don’t support wildcards, but you can do it with the redirects in your vercel.json file

{
  "redirects": [
    {
      "source": "/(.*)",
      "destination": "https://your-custom-domain.com/$1",
      "permanent": false
    }
  ]
}
1 Like