0π
The url www.foo.com?redirect=https://bar.com?a=b&b=c&c=d
is parsed into
redirect: https://bar.com?a=b
b: c
c: d
You need to encoded the value with, e.g. encodeURIComponent
in JS. Depend on your server lanaguage, you should use the corresponding method to encode the parameter/
encodeURIComponent('https://bar.com?a=b&b=c&c=d')
=> "https%3A%2F%2Fbar.com%3Fa%3Db%26b%3Dc%26c%3Dd"
Source:stackexchange.com