1

我创建了一个网站,可以说 example.com,现在我有一个功能,点击链接时应该将其移动到 nav.example.com。现在子域名可以是用户选择的任何名称,所以我无法创建子域,所以我谷歌发现带有“A”的通配符 DNS 条目可以访问该帐户。通过此更改,我可以成功 ping 子域,并且可以浏览它,但它始终显示服务器默认页面。

I tried many things :
[http://www.dennisonpro.info/simple-multitenancy-with-asp-net-mvc-4/][1]
[http://stackoverflow.com/questions/278668/is-it-possible-to-make-an-asp-net-mvc-route-based-on-a-subdomain][2]
[https://www.digitalocean.com/community/tutorials/how-to-set-up-and-test-dns-subdomains-with-digitalocean-s-dns-panel][1]
I have also added UrlRewrite :
 <rewrite >
      <rules>
        <rule name="CName to URL"  stopProcessing="true">
          <match url=".*" />
          <conditions>
            <add input="{HTTP_HOST}"  pattern="^(?!www)(.*)\.ebaraati\.com$" />
          </conditions>
          <action type="Rewrite" url="http://ebaraati.com/Preview/Index?url={C:1}" appendQueryString="false"  />
        </rule>
      </rules>
    </rewrite>


Any help would be appreciated ?



  [1]: http://www.dennisonpro.info/simple-multitenancy-with-asp-net-mvc-4/
  [2]: http://stackoverflow.com/questions/278668/is-it-possible-to-make-an-asp-net-mvc-route-based-on-a-subdomain

要求: 用户可以创建团队,每个团队都会有一个与之关联的子域。现在 user1 选择一个子域“teamA”。现在用户想要查看团队属性、成员映射,它将被重定向到 teamA.example.com

现在可以有n个团队,所以我不能为每个团队创建子域,所以我需要设置动态域系统。

4

2 回答 2

0

顺便说一句,Windows 2016 中的 IIS 10 支持通配符子域,您可以在 Plesk 17 中创建此类子域。

于 2016-09-29T08:55:16.107 回答
0

A 记录会将 URL 指向 IP 地址。如果您已将主域名(例如 example.com)设置为 IP 地址,则可以将 CNAME 记录用于子域:sub-domain.example.com

除非您为子域设置了托管,否则您创建了谁的 A 记录,您将看不到任何内容。

我不确定您要达到的目标。你能提供更多细节吗?

于 2015-11-06T18:29:17.633 回答