Results 1 to 2 of 2
  1. #1
    Join Date
    May 2002
    New Delhi, India

    website routing query

    hi there, i need a script for the following, or atleast a suggestion tho im not very good but can manage javascripts..

    I am hosting a website on a server, say, now i want to host another website say (diff content) on the same server, i need a script that will understand which website url has been asked for by the user and route him to that particular path on the server. i.e - the index page should have some intelligent script which can do this redirecting business. any ideas?
    thx in advance
    Whence this creation has arisen - perhaps it formed itself, or perhaps it did not.The one who looks down on it in the highest heaven, only he knows or perhaps he knows not

  2. #2
    Join Date
    Apr 2002
    Hopefully you're using ASP (WindowsNT Server or higher and IIS).

    The following script (server-side) will return the value of the requesting URL Server:

    <%@ Language="vbscript"%>



    So in ASP code you write the following script:

    <%@ Language="vbscript"%>
    Select Case Request.ServerVariables("SERVER_NAME")
    Case ""
    Case ""
    Case Else
    End Select

    Keep in mind that the case statement is CASE Sensitive (it's gotta match capitalization in order to return a match.)

    You can also use
    if ... then
    elseif... then
    end if

    ... and that is not CASE sensitive.

    You can find out more info on ASP at and ServerVariables in particular by going to

    To iterate through the whole collection use this:

    <%@ Language="vbscript" %>

    For each V in Request.ServerVariables
    response.write V & ": " & Request.ServerVariables(V) & "<br>"


    Hope this works for you.

Posting Permissions

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