2

I'm quite new to the configuration of domains and subdomains.

I already have a subdomain "bar" that belongs to the domain "www.foo.es". When I want to access to the subdomain I just have to type "www.foo.es/bar", everything is alright so far.

What I intend to do is that the subdominion is accessed typing "bar.foo.es".

I've tried some things I found online but none of them worked. Could you tell me how to do this or at least give me some clues or tutorials that actually work?

I'm trying to set all up using the IIS6 properties (not dynamically, as it is not a user thing, just a subdomain that I want to access "directly".

2
  • I already have a subdomain "bar" that belongs to the domain "www.foo.es". When I want to access to the subdomain I just have to type "www.foo.es/bar", everything is alright so far. - that's not a subdomain. Commented Dec 2, 2010 at 9:22
  • Hi Victor, didn't any of the replies below provide you any help? Commented Dec 3, 2010 at 9:38

2 Answers 2

5

Assuming you are working with a live server that you REMOTE DESKTOP INTO and not a shared hosting account here is what you will need to do:

Let's assume your file system looks like this:

c:\inetpub\wwwroot\www.foo.es { some html files in here}

c:\inetpub\wwwroot\www.foo.es\bar {some html files in here}

Without any custom ISAPI filters installed, you would do this by setting up two WEBSITE's in IIS.

The first website would have a home directory of c:\inetpub\wwwroot\www.foo.es and the 2 host headers "www.foo.es" and "foo.es"

The second website would have a home directory of c:\inetpub\wwwroot\www.foo.es\bar and 1 host header "bar.foo.es"

Once you DNS has a CNAME of "bar" that points to your server and you clear your local dns caches, this should work. If you don't know how to make the DNS change the easiest thing you can do is log into to your domain name control panel from whoever you purchased the domain name with and do the following:

ADD A CNAME RECORD: For the host enter "bar" for the points to enter "foo.es" and you should be all set.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you all, this was very useful and easy to follow. :)))
1

First of all you need to add an entry in your DNS in which you specify the "bar.foo.es" subdomain and the IP of the server to which it points to.

After that, in IIS you will have to create a site for the new subdomain you have just created. For that: right click on Web Sites -> New Website -> follow the steps normally but when you encounter the text box for the "Host header for this Web site (Default: None)" fill it with your subdomain value ("bar.foo.es").

Alternatively, if your web site is already created, you can bind subdomains to it by right clicking on the site -> properties -> Web site tab -> Advanced (the button near IP address) -> add / remove / edit the domains for your site which are represented by the "Host header value".

Please note that what you have at the moment ("www.foo.es/bar") is not a subdomain but a relative address.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.