问题描述
所以,这是我的要求。我正在建立一个多租户网站,公司在注册后可以获得自己的子域名。
假设我的公司名为Email Jobs Inc,域名为www.emailjobs.com。这个站点托管在一个共享的ISP环境中,所以我对IIS等的访问权限非常有限。
只是为了澄清一下,这是我需要的一个例子:
company1注册并获得此网址company1.emailjobs.com
company2注册并获得此网址company2.emailjobs.com
company3注册,他们得到这个网址:company3.emailjobs.com
我的理解是这里有一个DNS和IIS组件。也就是说,我需要更改DSN服务器中的条目,然后再更改IIS中的绑定。所有这些都非常棘手,因为非静态IP地址等等。
然而,我听说的另一个选择是要求你的ISP设置IIS通配符选项* .emailjobs.com直接进入我的ASP.NET MVC服务器。在那里,我可以解析URL,提取子域,我将在业务!对?
有人可以确认这是可能的吗?
我意识到我的另一个选择就是建立这样的网址:www.emailjobs.com/company1等,但这样会更不优雅。
我们将非常感谢任何反馈...
Best。
So, here are my requirements. I am building a multi-tenant site where companies after they sign up get their own subdomain.
Assume that my business is called Email Jobs Inc with domain www.emailjobs.com. This site is hosted in a shared ISP environment so I have very limited access to IIS etc.
Just to clarify, here is an example of what I need:
company1 signs up and they get this url company1.emailjobs.com
company2 signs up and they get this url company2.emailjobs.com
company3 signs up and they get this url: company3.emailjobs.com
My understanding is that there is a DNS and IIS component to this. That is, I will need to change an entry in a DSN server and then also a binding in IIS. All this is very tricky, because of non-static IP addresses, etc. etc.
However, another option I heard of is to ask your ISP to setup an IIS wildcard option where *.emailjobs.com goes straight to my ASP.NET MVC server. There I can parse the URL, extract the subdomain and I would be in business! Right?
Could someone confirm that this is possible and correct?
I realize that another option I have is to build urls like this: www.emailjobs.com/company1 etc, but that would be far less elegant.
Any feedback would be greatly appreciated...
Best.
这篇关于使用ASP.NET以编程方式在IIS上创建新网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!