开发者

How to create subdomain in IIS6

开发者 https://www.devze.com 2023-01-28 17:25 出处:网络
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 t开

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 t开发者_Python百科ype "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".


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消