Print Page | Close Window

Redirect based on the address

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=1140
Printed Date: 29 March 2026 at 12:51am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Redirect based on the address
Posted By: kcomer
Subject: Redirect based on the address
Date Posted: 19 March 2003 at 6:41am

How can I redirect based on the address the user requested. I have 2 websites that I would like to host under the same webspace. I have each in its own folder. I would like to write an if elseif statement to redirect based on the address the client used. I don't know ASP very well, but I do know other programming languages. I just need a quick solution until we can move these 2 sites to another provider. I've wanted to learn ASP, but haven't had time yet. I don't excpect someone to write the code for me but to point me in a good direction. I mostly do java, php and perl and don't even know where to start looking for ASP info.

Thanks,

Keith




Replies:
Posted By: fernan82
Date Posted: 19 March 2003 at 11:01am

Like this?

<%
If Request.ServerVariables("URL") = " http://site1.com - http://site1.com " Then
Response.Redirect "/site1"
Else
Response.Redirect "/site2"
End If
%>



-------------
FeRnAN
http://www.danasoft.com/">



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net