A kind of virtual hosting

Results 1 to 3 of 3

Thread: A kind of virtual hosting

  1. #1
    Crew Guest

    Default A kind of virtual hosting

    I have 3 domains pointing to one bit of hosting space. In other words whichever of the 3 you type in the browser address line one site loads. Now I want to catch 2 of the domains from the URL (or address line) and redirect this to another "site" hosted in a directory of the existing site. I was trying something like what I have below but it isn&#039;t working.<BR>&#060;% <BR>Dim URL<BR>URL = Request.QueryString<BR>%&#062;<BR><BR>&#060;%<BR>I f URL = "http://www.MySite.com" Or _<BR> URL = "http://www.MySite.co.uk" Then<BR>Response.Redirect("MySite/Index.asp")<BR>%&#062;<BR>&#060;%<BR>Else Response.Redirect("index.asp")&#039;to load current site index page<BR>%&#062;<BR>&#060;%<BR>End If<BR>%&#062;<BR>I also fiddled about with Request.ServerVariables("HTTP_REFERER")<BR>instead of Request.Querystring but that doesn&#039;t do it either.<BR>Any thoughts?

  2. #2
    Steve Cimino Guest

    Default RE: A kind of virtual hosting

    Use the HTTP_REFERER, but beware that when you do = in VBScript, it will be case sensitive.<BR><BR>Try<BR><BR>If UCase(Request.ServerVariables("HTTP_REFERER") = "HTTP://WWW..."<BR><BR>Alternatively, you could use InStr() with a textual comparison to see if your string exists (which would probably be better since you could just look for MySite instead of the whole URL)

  3. #3
    Crew Guest

    Default HTTP_Referer not appearing

    Thanks for the guidance. It didn&#039;t quite work. I then decided to just write the result of HTTP_REFERER to the page to see if that&#039;s not where the problem lies. When I did a Response.Write of the HTTP_REFERER nothing appeared. Not much point in trying to use it for a Redirect if it doesn&#039;t even appear.<BR>Other than a possible syntax error (which I can&#039;t see) what could cause this to not appear?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts