You'll have to excuse me, asp isn't my thing... Heres what I am trying to do. There is a link out there: /cmd.asp?af=415652&u=http://www.drdavesbest.com/fountain_of_youth.html and right now it leads to the page it says there at the end of the URL. I need it to lead to http://www.drdavesbest.com/misc/fountain_of_youth.html But I don't have control over the original link (it's on an affiliates website). The existing ASP script looks something like this: if request("af")<>"" then 'aftrack dest=baseurl&"/app/aftrack.asp?afid="&request("af")&"&u="&request("u") elseif request("ad")<>"" then 'adtrack dest=baseurl&"/app/adtrack.asp?adid="&request("ad") elseif request("imp")<>"" then 'Track Impressions dest=baseurl&"/app/?imp="&request("imp") elseif request("clk")<>"" then 'Track Clicks dest=baseurl&"/app/?clk="&request("clk") elseif request("email1")<>"" then 'contact dest=baseurl&"/app/contactsave.asp?merchantid="&merchantid if request.querystring<>"" then dest=dest & "&" & request.querystring if request.form<>"" then dest=dest & "&" & request.form Code (markup): Is there an 'if' statement that I can put in there to do the redirect? What would it go? Do I need to change anything up there? Is this even possible? Thx!
Yes, you're the second person to suggest this to me.. How do I implement that in the above code? Thx a million for your help!
I noticed that the URL that you want it to go to has a "misc" directory between the domain and the page name, but it is not there in the URL in the "u" paramter. Do you need to add the "misc" directory into the path when you redirect?
could you please explain what is doing your code if request("af")<>"" then 'aftrack dest=baseurl&"/app/aftrack.asp?afid="&request("af")&"&u="&request("u") elseif request("ad")<>"" then 'adtrack dest=baseurl&"/app/adtrack.asp?adid="&request("ad") elseif request("imp")<>"" then 'Track Impressions dest=baseurl&"/app/?imp="&request("imp") elseif request("clk")<>"" then 'Track Clicks dest=baseurl&"/app/?clk="&request("clk") elseif request("email1")<>"" then 'contact dest=baseurl&"/app/contactsave.asp?merchantid="&merchantid if request.querystring<>"" then dest=dest & "&" & request.querystring if request.form<>"" then dest=dest & "&" & request.form Code (markup): i think you need to do the following: response.redirect dest response.end Code (markup): or you need to do the following response.redirect request.querystring("u") response.end Code (markup): I am not sure what is your code for you need to add the above lines at the very end of your document
The code is to determine which affiliate gets credit for the link, then redirect them to the proper page. Depending on the URL string they come from, a different action is assigned.
This is very simple, You only need to write the redirection code. Syntax for it is. Response.redirect("Abc.html"). In your case. if we apply redrirection it wil become if request("af")<>"" then 'aftrack dest=baseurl&"/app/aftrack.asp?afid="&request("af")&"&u="&request("u") response.redirect(dest) elseif request("ad")<>"" then 'adtrack dest=baseurl&"/app/adtrack.asp?adid="&request("ad") response.redirect(dest) elseif request("imp")<>"" then 'Track Impressions dest=baseurl&"/app/?imp="&request("imp") response.redirect(dest) elseif request("clk")<>"" then 'Track Clicks dest=baseurl&"/app/?clk="&request("clk") response.redirect(dest) elseif request("email1")<>"" then 'contact dest=baseurl&"/app/contactsave.asp?merchantid="&merchantid response.redirect(dest) Hope it helps you..