URL Encode Base64 Strings for URL Parameters
Quick Answer: Standard Base64 contains + / and = characters that are not URL-safe. Either URL-encode the Base64 string (+ becomes %2B, / becomes %2F, = becomes %3D) or use Base64url encoding which replaces these characters at the encoding level.
FAQ
Should I URL-encode Base64 or use Base64url?
Use Base64url (replaces + with -, / with _, removes =) when you control both encoding and decoding. URL-encode standard Base64 when you must use existing Base64 values.
Why does Base64 break URLs?
The + character means "space" in URL query strings. / is a path separator. = is the parameter delimiter. All three must be encoded or replaced for URL safety.