如何在IIS6中创建子域

发布于 2024-10-06 03:19:25 字数 266 浏览 0 评论 0原文

我对域和子域的配置很陌生。

我已经有一个属于域“www.foo.es”的子域“bar”。当我想访问子域时,我只需输入“www.foo.es/bar”,到目前为止一切都很好。

我打算做的是输入“bar.foo.es”来访问子域。

我尝试了一些在网上找到的东西,但没有一个起作用。您能告诉我如何做到这一点,或者至少给我一些实际有效的线索或教程吗?

我正在尝试使用 IIS6 属性(不是动态的,因为它不是用户的事情,只是我想“直接”访问的子域)来设置所有内容。

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".

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

风筝在阴天搁浅。 2024-10-13 03:19:25

假设您正在使用远程桌面进入的实时服务器,而不是共享托管帐户,您需要执行以下操作:

让我们假设您的文件系统如下所示:

c:\inetpub\wwwroot\www.foo.es {一些 html 文件在此处}

c:\inetpub\wwwroot\www.foo.es\bar {一些 html 文件在此处}

如果没有安装任何自定义 ISAPI 过滤器,您可以通过在 IIS 中设置两个网站来实现此目的。

第一个网站的主目录为 c:\inetpub\wwwroot\www.foo.es 以及 2 个主机标头“www.foo.es”和“foo.es”

第二个网站的主目录为 c: \inetpub\wwwroot\www.foo.es\bar 和 1 个主机标头“bar.foo.es”

一旦您的 DNS 具有指向您的服务器的 CNAME“bar”并且您清除了本地 dns 缓存,这应该可以工作。如果您不知道如何更改 DNS,您可以做的最简单的事情就是从您购买域名的人处登录您的域名控制面板,然后执行以下操作:

添加 CNAME 记录:
对于主机,请输入“bar”,对于输入“foo.es”的点,您应该已全部设置完毕。

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.

离去的眼神 2024-10-13 03:19:25

首先,您需要在 DNS 中添加一个条目,在其中指定“bar.foo.es”子域及其指向的服务器的 IP。

之后,您必须在 IIS 中为刚刚创建的新子域创建一个站点。为此:右键单击网站 ->新网站->按照正常步骤操作,但当您遇到“此网站的主机标头(默认:无)”文本框时,请填写您的子域值(“bar.foo.es”)。

或者,如果您的网站已经创建,您可以通过右键单击该网站 -> 来将子域绑定到它。属性->网站选项卡 ->高级(IP 地址旁边的按钮)->添加/删除/编辑由“主机标头值”表示的站点域。

请注意,您现在拥有的(“www.foo.es/bar”)不是子域,而是相对地址。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文