Multiple websites on One IP |
| | | | Submitted on: 11/20/2003 8:04:10 AM
By: Richard J Mackey
Level: Beginner User Rating: Unrated Compatibility:ASP (Active Server Pages)
Users have accessed this article 1673 times. | |
| | An easy way to host multiple websites on one IP address This article has accompanying files | |
|
|
Terms of Agreement:
By using this article, you agree to the following terms...
1) You may use
this article 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 article (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 article 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 article or article's description. | In IIS 5.x (XP or 2k) the user is only
permitted one web site.
This is a work around that allows
multiple websites to be hosted on one
IP. In my situation I am using a DNS
to point all 3 of my sites to my single IP.
I then have a default.asp page that handles
the re-direction to the proper start page
for the website requested.
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.
| |
Download article
Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.
Virus note:All files are scanned once-a-day by Planet Source Code for viruses,but new viruses come out every day, so no prevention program can catch 100% of them.
FOR YOUR OWN SAFETY, PLEASE: 1)Re-scan downloaded files using your personal virus checker before using it. 2)NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com
|
Terms of Agreement:
By using this article, you agree to the following terms...
1) You may use
this article 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 article (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 article 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 article or article's description. |
Other 1 submission(s) by this author
|
|
|
Report Bad Submission |
|
|
Your Vote! |
See Voting Log |
|
Other User Comments |
11/20/2003 8:16:10 AM:Richard J Mackey Sorry--It striped the code out and so
far unable to locate details on how to
correct
|
11/20/2003 8:56:46 AM:Mark Kahn be more specific...IIS5 allows
unlimited websites. The version
shipped with XP or 2k Pro only allows
one.
|
11/20/2003 9:27:04 AM:Sarafraz Singh Johl well i haven't looked at code yet. but
one question. which site will open if i
type "http://IP_ADDRESS"
cassamine
|
11/20/2003 11:02:38 AM:Richard J Mackey In my case as set up in the final else
in the code it will redirect the surfer
to then index.htm page which has links
to all three of my sites
|
|
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 article 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 article, please click here. |
|