Forum Moderators: open

Message Too Old, No Replies

Redirect by URL id

Keeping a part of the link but changing the rest

         

mipsy

10:07 am on Aug 25, 2004 (gmt 0)



Thx for a great site with a lot of info.. i havent found any code here to do this. Can someone post me a helpfull hint? :-)

I want to redirect people from a link to a page fromm one server to another based on a number ID in the link

From:
[myserver.com...]

All links wiht "Nr" 1120 should be routed to the other server but still keeping the Id.

[anotherserver.com...]

Any comments would be helpfull
Thx

Dreamquick

11:41 am on Aug 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Assuming myserver.com/app/processForm.asp exists then you could add something like this into the top of the page;

Dim sURL

If Request.QueryString("NR") = "1120" Then

sURL = "http://anotherserver.com/app2/processForm.asp?"
sURL = sURL & Request.QueryString

Response.Redirect sURL

End If

Which will pass whatever data was in the querystring to the second server - if you wanted to be more picky about the variables you're passing then you could quite easily just add them individually while building up sURL.

- Tony