Reply to topic
Using asp to redirect users to desired page
Suzanne Kirkland


Joined: 08 Jan 2006
Posts: 4
Location: West Chester, Pa.
Reply with quote
I am sharing one 'account' across two small websites, and therefore have two domain names pointing to one IP address. I am trying to write a quasi-simple redirect script that will redirect visitors to the proper folder/file based on the incoming URL, but I keep getting the jscript runtime error "object doesn't support property or method - line5 (bold)" in response to the code below. It seems as though SiteName is not being recognized as a string. Can anybody out there tell me what the problem is before I have to be institutionalized Confused !

<% @language="javascript"%>
<%
var SiteName,folder;
SiteName = Request.ServerVariables("HTTP_HOST");
SiteName = SiteName.toLowerCase();

If (SiteName.match("obhenterprises") == "obhenterprises")
{
folder="f1";
}
Elseif (SiteName.match("troop96") == "troop96")
{
folder="f2";
}
Else
{
folder = "NoMatch";
}
Endif
Response.Redirect ("http://"&SiteName&"/"&folder&"/index.htm/")
%>
FlashMerlot


Joined: 23 May 2006
Posts: 4
Reply with quote
Not sure, but you might try ...


SiteName = SiteName.toString().toLowerCase();
Using asp to redirect users to desired page
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic