J
JPElectron
I'm looking for a way to redirect based on when more than one condition is
met, I think I proably need some if/then statements? Can someone provide a
sample code or point me in the right direction...
Here's what I've got:
<%
Dim sScriptname, sRedirect
sScriptname = LCase(Request.ServerVariables("QUERY_STRING"))
response.write sScriptname
Select Case True
Case Instr(sScriptname, "392x72") > 0
sRedirect = "/392x72.htm"
Case Instr(sScriptname, ".htm") > 0
sRedirect = "/404.htm"
Case Instr(sScriptname, ".gif") > 0
sRedirect = "/blank.gif"
Case Instr(sScriptname, ".jpg") > 0
sRedirect = "/blank.jpg"
Case Instr(sScriptname, ".swf") > 0
sRedirect = "/blank.swf"
Case Else
sRedirect = "/ohcrap.htm"
End Select
Response.Redirect sRedirect
%>
What I'd really like to happen here is if "392x72" -and- ".gif" are found
then redirect to 392x72.gif and if "392x72" -and- ".htm" are found then
redirect to 392x72.htm Is this possible?
Thanks very much in adavnce, I'm new to this.
met, I think I proably need some if/then statements? Can someone provide a
sample code or point me in the right direction...
Here's what I've got:
<%
Dim sScriptname, sRedirect
sScriptname = LCase(Request.ServerVariables("QUERY_STRING"))
response.write sScriptname
Select Case True
Case Instr(sScriptname, "392x72") > 0
sRedirect = "/392x72.htm"
Case Instr(sScriptname, ".htm") > 0
sRedirect = "/404.htm"
Case Instr(sScriptname, ".gif") > 0
sRedirect = "/blank.gif"
Case Instr(sScriptname, ".jpg") > 0
sRedirect = "/blank.jpg"
Case Instr(sScriptname, ".swf") > 0
sRedirect = "/blank.swf"
Case Else
sRedirect = "/ohcrap.htm"
End Select
Response.Redirect sRedirect
%>
What I'd really like to happen here is if "392x72" -and- ".gif" are found
then redirect to 392x72.gif and if "392x72" -and- ".htm" are found then
redirect to 392x72.htm Is this possible?
Thanks very much in adavnce, I'm new to this.