Common URL encoding mistakes that break links and redirects
A practical guide to the most common URL encoding mistakes, including double encoding, broken query strings, bad parameters and redirect issues.
Double encoding is the fastest way to ruin a URL
A common mistake is encoding a value more than once. A query parameter like `a%20b` can turn into `a%2520b` after a second pass, which makes the URL harder to read and often changes what the backend receives.
This usually happens when one layer encodes the value and another layer does it again before building the final link. The fix is simple: encode once at the point where the raw value enters the URL, then leave it alone.
Broken queries and redirects usually come from mixed contexts
Another frequent problem is using the wrong encoding rules for the wrong part of the URL. Query parameters, path segments and redirect targets do not behave the same way, so a value that looks safe in one place can break in another.
Redirects are especially sensitive because an already encoded destination can get decoded, re-encoded or truncated by intermediate systems. If a link contains spaces, ampersands or reserved characters, verify the final output before shipping it.