Response Redirect Semicolon Problem

When I do the below code, ASP is taking out the semicolons and going to:

http://z1.adserver.com/w/cp.x%3Bmid%3D15664%3Brid%3D322%3Btid%3D3%3Bev%3D2%3Bdt%3D3%3Bac%3D76%3Bc%3D71%3B

I need the semicolons to stay.  Please help.

============================================================
<%
url = "http://z1.adserver.com/w/cp.x;mid=15664;rid=322;tid=3;ev=2;dt=3;ac=76;c=71;"
response.redirect(url)
%>
============================================================
sixdegreeAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

aprestoCommented:
semi colons are invalid in the url,

why do you need them, maybe you can replace them with another character and convert them back at serverside?

what are they for?
aprestoCommented:
or just use & if you want to seperate the variables, are they variables and valu key pairs?
sixdegreeAuthor Commented:
They're not invalid.  If you copy/paste it into your address browser it works perfectly fine.

http://z1.adserver.com/w/cp.x;mid=15664;rid=322;tid=3;ev=2;dt=3;ac=76;c=71;
Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

aprestoCommented:
sorry i didnt mean invalid, but if you parse them with asp they are converted.

why dont you try and wrap this around it.

server.URLencode()
sixdegreeAuthor Commented:
This is the page i'm working with:

http://register01.playbingolive.com/upsellit.asp?do=register

it redirects using:

url = "http://z1.adserver.com/w/cp.x;mid=15664;rid=322;tid=3;ev=2;dt=3;ac=76;c=71;"
response.redirect(server.URLencode(url))

Which doesn't work either.

deighcCommented:
Try:

url = "http://z1.adserver.com/w/" & Server.URLEncode("cp.x;mid=15664;rid=322;tid=3;ev=2;dt=3;ac=76;c=71;")
leos_Commented:
sixdegree,

This was a hard problem, and I think the problem is in "response.redirect" automatically running a urlencode.

When you use response.redirect what actually happens is a HTTP 302 response header is sent to the browser telling the browser that the web page has moved.  For quite a while browsers automatically redirects the user to the new location.  To the user it seems like the page redirect is done on the server side.  In anycase, if you simulate the http 302 response it solves your problem.

Here is the code:

<%

url = "http://z1.adserver.com/w/cp.x;mid=15664;rid=322;tid=3;ev=2;dt=3;ac=76;c=71;"

Response.Status = "302 Object Moved"
Response.AddHeader "Location", url
Response.Write "<HTML>"
Response.Write "<BODY>"
Response.Write "This file was moved to "
Response.Write "<A HREF=""" & url & """>here.<A>"
Response.Write "</BODY>"
Response.Write "</HTML>"
Response.End

%>

and if you want to, you could write your own function called ResponseRedirect(url) which would call that.

hmm.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.