在IIS中为Web应用程序处理子域 [英] handling sub-domains in IIS for a web application

查看:85
本文介绍了在IIS中为Web应用程序处理子域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在本地IIS(mylocalsite.com)上有一个Web应用程序
我需要什么设置,以便可以处理本地站点的所有子域,例如

I am have a web application on local IIS (mylocalsite.com)
What settings I need, so that I can handle all subdomains of my local site, like

user1.mylocalsite.com
user2.mylocalsite.com
everything.mylocalsite.com

user1.mylocalsite.com
user2.mylocalsite.com
anything.mylocalsite.com

所有url都指向同一个索引页面,我可以在其中分隔子域并相应地加载页面.

All urls will point to same index page from where I can seperate subdomain and load page accordingly.

推荐答案

由于您的描述不清楚,我最初的想法是,您可以在IIS中设置不同的Bindings来满足所有子域的需要.

Since your description is not that clear, my initial thought would that you can setup different Bindings in IIS to cater for all the subdomains.

在IIS 7中,右键单击您的网站->编辑绑定->添加.

In IIS 7, right click your website -> Edit Bindings -> Add..

但是我的猜测是,由于用户已添加到系统中(假设用户/子域模型),因此您可能需要通过代码执行此操作.为此,我请您参考

But my guess would be that you may need to do this from code, since users are added to your system (assuming user/sub-domain model). For this I refer you to

  • Create Binding in in IIS (iis.net)
  • Cool new IIS7 Features and APIs - ScottGu
  • Microsoft.Web.Administration

这篇关于在IIS中为Web应用程序处理子域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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