Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to set up several web sites on my home server (running windows 7). Lets say ive got the domain lol.com. At this address im hosting some really lol stuff, but just for the kicks ive also want to have mail.lol.com that should lead into the webclient for the mail.

lol.com is hosted in c:\www\www\ and mail.lol.com is hosted in c:\www\mail\. The default website (lol.com) is already redirected and works like a charm, but how do i config IIS 7.5 so it understands that when it gets a request like mail.lol.com it should redirect to c:\www\mail\?

mail.lol.com is a seperate site ive created with its own physical path in IIS and it's binding is http(type) layout.localhost(host) 80(port) *(IP-address), but where do i do the actuall checking of the request and redirecting?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Your binding should be the same as address of your subdomain. mail.lol.com should have a binding with the same address. When a browser makes a request it sends a host header "mail.lol.com", that's how IIS knows which site to serve.

share|improve this answer
    
i've checked it, default web site looks like this: http(type) <blank>(hostname) 80(port) *(ip-address), mail binding looks like this: http(type) mail.localhost(hostname) 80(port) *(ip-address). IS THIS the way i should do it? –  Jason94 Aug 16 '11 at 9:27
    
No, your hostname should be mail.lol.com instead of mail.localhost –  ZippyV Aug 16 '11 at 9:34
    
thank you for the explanation! :-) –  Jason94 Aug 16 '11 at 10:17
add comment

Assuming you've got the site setup properly in IIS and you have the binding set to mail.lol.com, then the last step is to setup your DNS.

If lol.com is an actual domain that you have registered, you need to modify the DNS records for lol.com and add an A Record which points to whatever IP Address your IIS machine is listening on.

For clarification, an A Record is simply a record which ties a particular domain name to an IP address. (Wikipedia list of DNS Record Types)

If you don't have access to DNS records, or if this is just for machines in your home LAN, then you can achieve the same results by simply adding an entry in your local machines' host files. The file is found at c:\windows\system32\drivers\etc\hosts. For each machine, add a line with the hostname (mail.lol.com) and ip address of the server and you should be good to go.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.