Quick Search for:  in language:    
IIS,user,only,permitted,site,work,around,allo
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
ASP/ VbScript Stats

 Code: 203,988. lines
 Jobs: 110. postings

 How to support the site

 
Sponsored by:

 
You are in:
 
Login


 

 


Latest Code Ticker for ASP/ VbScript.
aZoaPeS
By Simeon Albertson on 1/20


Move Window , Funs Stuff
By Jareh Ali Mohamed H. Al-Malki on 1/19


Click here to see a screenshot of this code!Rapid Classified v2.0
By Gurgen Alaverdian on 1/17

(Screen Shot)

Click here to see a screenshot of this code!Gallery Image with Zoom
By Marcelo Valle Franco on 1/12

(Screen Shot)

Click here to see a screenshot of this code!ASP Photo Competition
By Saul Bryan on 1/12

(Screen Shot)

Execute DTS package
By Himadrish Laha on 1/12


Connecting to a MySQL with ADO, DAO and RDO
By Ahmed Magdy Ezzeldin on 1/11


Automatic Form Insertion To Database
By Yasar Bayar on 1/11


Click here to see a screenshot of this code!Find Closest Physical Location (based on zip code, etc)
By Mark Kahn on 1/11

(Screen Shot)

Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!

Affiliate Sites



 
 
   

Multiple Web Sites on one IP

Print
Email
 
VB icon
Submitted on: 11/20/2003 9:29:27 AM
By: Richard J Mackey 
Level: Beginner
User Rating: Unrated
Compatibility:ASP (Active Server Pages), VbScript (browser/client side)

Users have accessed this code 1523 times.
 
 
     In IIS 5.x (XP or 2k) the user is only permitted one web site. This is a work around that allows multiple web sites to be hosted on oneIP.

 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

    '**************************************
    ' Name: Multiple Web Sites on one IP
    ' Description:In IIS 5.x (XP or 2k) the 
    '     user is only permitted one web site. 
    This is a work around that allows multiple web sites To be hosted on oneIP.
    ' By: Richard J Mackey
    '
    ' Assumes:In my situation I am using a D
    '     NS to point all 3 of my sites to my sing
    '     le IP. I then have a default.asp page th
    '     at handles the re-direction to the prope
    '     r start page
    For the website requested.
    My deault.asp (With the url's changed To protect the innocent).
    The key parts:
    The use of the Web_Site_#. 
    This is used 6 times With the only change being
    the use (obviously) of the name of your website.
    In my Case it also included the use of three
    different web types( .com, .us, and .net ).
    You will notice the use of one instance where the
    url does Not have the "www" While the other does.
    This allows web surfers To find your page With or
    With out the use of the "www" In their browser.
    The use of three redirect pages.
    When the if statement finds a match the ASP code
    redirects the browser To the proper start page For that site. The url of the website(less the actual page address is displayed In the surfers browser and they are none the wiser that they were redirected.
    The final Else which redirects To index.htm sends the surfer to my main IP address which has links to all three sites. This is the page that all surfers will see if they enter just my IP address. You can put anything in your index.htm that you like.
    My first submission so please be kind.
    if you have questions or advise feel free To contact me.
    '
    'This code is copyrighted and has    ' limited warranties.Please see http://w
    '     ww.Planet-Source-Code.com/vb/scripts/Sho
    '     wCode.asp?txtCodeId=8632&lngWId;=4    'for details.    '**************************************
    
    <%@ Language = "VBScript" %>
    <% Response.Buffer = True %>
    <%if Request.ServerVariables("HTTP_HOST")="Web_Site_One.com" or
    Request.ServerVariables("HTTP_HOST") = "www.Web_Site_One.com" Then
    Server.Execute("Web_Site_One.htm")
    ElseIf 
    Request.ServerVariables("HTTP_HOST")="Web_Site_Two.us" or
    Request.ServerVariables("HTTP_HOST")="www.Web_Site_Two.us" Then 
    Server.Execute ("Web_Site_Two.htm") 
    ElseIf Request.ServerVariables("HTTP_HOST")="Web_Site_Three.net" or
    Request.ServerVariables("HTTP_HOST")="www.Web_Site_Three.net" Then 
    Server.Execute ("Web_Site_Three.htm")
    else
    Server.Execute ("index.htm")
    End if %>


Other 1 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
11/21/2003 9:36:48 AM:
Why not just use the Host Headers field 
in IIS?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
11/21/2003 2:18:17 PM:Richard J Mackey
As stated in the description. XP and 
Windows 2k Pro do not support more than 
one site.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
11/24/2003 10:35:11 AM:Brian Battles WS1O
He's talking about the workstation 
versions of Windows. In Windows Server 
200x you can define all the Web 
sites/domains you want in the MMC
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
11/24/2003 6:33:56 PM:Mark Kahn
For this to work properly, you also 
need to map this page to the error 404. 
 I'll worship anyone that can tell me 
how to get querstring variables through 
the 404 handler so this can work 
properly.  cwolves@cwolves.com
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | ASP/ VbScript Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.