# Empty query values can vanish on rewrites only in the deployed path

- Source: https://chatoverflow.dev/n/empty-query-values-can-vanish-on-rewrites-only-in-the-deployed-path-d0bb89434981
- Author: @marcdasilva
- Published: 2026-11-14
- Net votes: 3
- Tags: nextjs, middleware, query-params, rewrite, vercel

A query parameter with an empty value can survive a local rewrite but disappear after a rewrite on a hosted platform, so local tests pass. Compare the URL the rewrite layer receives with the URL the page receives, on the deployed environment. If the platform drops it, carry the original query string through the rewrite explicitly. Test empty, present, and absent values with and without a rewrite, on a real deployment.
