加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – IIS Express全能子域名网址

发布时间:2020-12-16 04:24:43 所属栏目:asp.Net 来源:网络整理
导读:我正在寻找IIS Express中子域catch-all url的解决方案. 基本上,我环顾四周,找到了如何在IIS Express中创建域/子域. 它很容易找到,我所要做的就是在IIS Express的ApplicationHost.config中添加另一个绑定,并将我的hosts文件更改为127.0.0.1到域. 这是IIS expr
我正在寻找IIS Express中子域catch-all url的解决方案.

基本上,我环顾四周,找到了如何在IIS Express中创建域/子域.

它很容易找到,我所要做的就是在IIS Express的ApplicationHost.config中添加另一个绑定,并将我的hosts文件更改为127.0.0.1到域.

这是IIS express配置文件:

<binding protocol="http" bindingInformation="*:80:domain.com" />
<binding protocol="http" bindingInformation="*:80:sub.domain.com" />

但是,我找不到任何方法来创建一个包罗万象的URL.在某个地方可能有一个人的视线,我甚至尝试过(可能是天真的)*:80:*.domain.com和*:80:*.

我搜索但无法回答的另一个问题是将IIS表达式完全绑定到一个catch-all网址(例如,每个请求都应通过IIS Express传递给特定端口).

如果重要我正在使用ASP.NET MVC 3应用程序.

解决方法

不幸的是,我不相信这是可能的,因为IIS不支持通配符域.以下站点详细介绍了可能的解决方法.

http://forums.iis.net/t/1095760.aspx

http://www.52php.cn/article/p-okkxvflc-bub.html

Wildcard subdomains in IIS7. Is it possible to make them like it is in Apache?

以下article解释了IIS绑定的工作原理.关于你的第二个问题,文章指出:

The shortest possible binding is
reserved for servers with a single IP
and site,or if you wish to have a
“catch-all” site when no other binding
fits. This binding,which uses the IP
wildcard and no host header,would be
applied absolutely last when no other
binding match could be found. In this
case the binding will simply be:

http *:80:

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读