在注册时创建子域 [英] creating sub-domains on signup

查看:161
本文介绍了在注册时创建子域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在建立一个网站,企业可以注册自己的帐户,该帐户应位于 http ://businessname.example.com ,每次都更改businessname。

I'm building a site where businesses will be able to sign-up for there own account which should be located at http://businessname.example.com with the "businessname" changing each time.

我想在Windows服务器(IIS 7)上执行此操作但是我不知道怎么回事。

I want to do this on a windows server (IIS 7) but am not sure how a go about it.

推荐答案

首先,您必须配置DNS服务器以解析* .example.com到你的服务器的IP。

First, you have to configure your DNS server to resolve *.example.com to the IP of your server.

然后,你有两个选择:


  • 每次创建新帐户时,都会将其主机添加到IIS的配置中,因此它将绑定到目录。我不确定如何以编程方式执行此操作。

  • 每次向服务器发出请求时,都会检查主机,并将客户端重定向到与主机对应的站点。它可以是显式重定向(客户端到达 http://businessname.domain.com/ 并且重定向到 http://sites.example.com/businessname/ )或隐含(客户端)到达 http://businessname.example.com/ 并在内部,位于专用目录上的应用程序businessname并处理请求。

  • Every time a new account is created, you add its host to the configuration of IIS, so it is bound to a directory. I'm not sure how to do this programmatically.
  • Every time a request is made to the server, you check the host, and redirect the client to the site corresponding to the host. It can either be an explicit redirect (the client arrives on http://businessname.domain.com/ and is redirected to http://sites.example.com/businessname/ ) or implicit (the client arrives on http://businessname.example.com/ and internally, the application located on a directory dedicated to businessname and treats the request.

这篇关于在注册时创建子域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆