Alireza Mahmoudi
Alireza Mahmoudi

Reputation: 994

how to send a url with query string (containing a url as a query string) as a query string

I need to redirect to a url which is sent to my application as a query string that containing a url as a query string. This can be repeated in three or four levels.

Suppose my application is accessible using example.com, and I have a request like:

http://example.com/?landing={http://example2.com/?landing={http://example3.com/?landing={http://google.com}&param=4}&param=3}&param=1

'{' and '}' are used to increase readability and do not exist in the urls actually.

I have to redirect to

http://example2.com/?landing={http://example3.com/?landing={http://google.com}&param=4}&param=3

example2 has to redirect to

http://example3.com/?landing={http://google.com}&param=4

and example3 has to redirect to http://google.com

I don't know how to sent the 'landing' query strings such that each query string be passed to the corresponding address to be consumed, or how to access the query strings correctly in my application, or on example2.com or example3.com. Need your help, Tnx...

Upvotes: 2

Views: 92

Answers (1)

Alireza Mahmoudi
Alireza Mahmoudi

Reputation: 994

I solved the problem by encoding(urlencoding or base64encoding) the query strings in source and send the user to corresponding page. On that page the query string is decoded and the user is redirect to the next one query string and this process is done till the last landing page.

Upvotes: 2

Related Questions