Forum Moderators: open

Message Too Old, No Replies

Multiple Domains, One IIS (XP Server) & Multiple sites

Multiple Domains, One IIS (XP Server) & Multiple sites

         

Peterpan

9:37 am on Dec 18, 2002 (gmt 0)



Ok, so I have IIS running on XP (only allows for 1 web site). I have several domain names from Dynamic DNS providers pointing to my 1 server e.g.

me.domain1.com
me.domain2.com

What I would like to do is point the different domains to different virtual directories.

Is there a way to do it in IIS or even in HTML by reading the address bar and then redirecting?

Thanks,

Peterpan

[edited by: Lisa at 3:31 pm (utc) on Dec. 18, 2002]
[edit reason] generic names [/edit]

Krapulator

8:13 am on Dec 20, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could put a default.asp in the root directory. And put a server script in to redirect based on the url.

Do a google search on SERVER VARIABLES

Krapulator

8:27 am on Dec 20, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Even better heres the way to do it:
<%
domainname = request.servervariables("HTTP_HOST")
SELECT CASE domainname
CASE "me.domain1.com" response.redirect "site1.htm"
CASE "me.domain2.com" response.redirect "site2.htm"
CASE ELSE response.redirect "home.htm"
END SELECT
%>

Peterpan

11:54 am on Dec 20, 2002 (gmt 0)



Thanks Krapulator.

Whilst waiting for a reply I found a way to do it with PHP ... after much bumbling in installing PHP on IIS and writting my first PHP script I got it to work .... though I think I will use your ASP method instead.

Thanks again,

Peterpan.