![]() |
| Using asp to redirect users to desired page |
|
Suzanne Kirkland
|
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
<% @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
|
Not sure, but you might try ...
SiteName = SiteName.toString().toLowerCase(); |
||||||||||||
|
|
|||||||||||||
| Using asp to redirect users to desired page |
|
||
|


