简体   繁体   English

IIS上的子域

[英]subdomain on IIS

My website will look something like online store, where every user has his online store as subdomain eg user1.myprojectdomain.com 我的网站看起来像在线商店,其中每个用户都将其在线商店作为子域,例如user1.myprojectdomain.com

we need help that how can Manage sub domains. 我们需要有关如何管理子域的帮助。 Do we create a Virtual Directory/application for every user in the IIS on runtime or we can do some thing else 我们是在运行时为IIS中的每个用户创建虚拟目录/应用程序还是做其他事情

I have created a website xyz.com in my iis and created an entry in windows etc/localhost as follows 我在iis中创建了一个网站xyz.com ,并在Windows etc/localhost创建了一个条目,如下所示

xyz.com   127.0.0.1

and it is working fine. 而且工作正常。 and then I did added another entry to route all sub domains as follows 然后我确实添加了另一个条目来路由所有子域,如下所示

*.xyz.com   127.0.0.1

Now I am trying to use abc.xyz.com or any other but it is not working 现在,我尝试使用abc.xyz.com或其他任何文件,但无法正常工作

1) Make sure your DNS is setup to point to your subdomain. 1)确保将DNS设置为指向您的子域。 This means to make sure you have an A Record in the DNS for your subdomain and point to the same IP. 这意味着要确保您的子域在DNS中具有A记录,并指向相同的IP。

2) You must add an additional website in IIS 7 named subdomain.site.com 2)您必须在IIS 7中添加一个名为subdomain.site.com的其他网站。

Sites > Add Website Site Name: subdomain.site.com Physical Path: select the subdomain directory Binding: same ip as site.com Host name: subdomain.site.com 网站>添加网站网站名称:subdomain.site.com物理路径:选择子域名目录绑定:与site.com相同的IP主机名:subdomain.site.com

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM