使用子路径在一个Web角色托管的两个Web应用程序? [英] Use Subpath for two web applications hosted in one Web Role?

查看:141
本文介绍了使用子路径在一个Web角色托管的两个Web应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们必须在一个云服务两个Web应用程序,因为我们想用两个相同的端点,我们preFER托管在一个Web角色这两个Web应用程序。 此博客想通了这是可能的,只要我们添加的网站下一个新的站点节点。

We have two web applications in one Cloud Service, since we want to use the same endpoint for both, we prefer to host these two web applications in one Web Role. This blog figured out it's possible, as long as we add a new site node under Sites.

我们的要求是,我们在这样的URL主机WEB2: http://appname.cloudapp.net/web2,所以如果顾客点击 http://appname.cloudapp.net ,它会显示WEB1,和< A HREF =htt​​p://appname.cloudapp.net/web2相对=nofollow> http://appname.cloudapp.net/web2 它会显示在web2,使用这样的子路径区分这两种网络applciations。

Our requirement is that we host Web2 in such url: http://appname.cloudapp.net/web2, so if customer click http://appname.cloudapp.net, it will show Web1, and for http://appname.cloudapp.net/web2 it will show web2, use something like subpath to distinguish the two web applciations.

这可能吗?

推荐答案

您只需要使用站点和虚拟应用程序的组合来实现这一目标。

You just need to use a combination of Sites and Virtual applications to achieve that goal.

在您的csdef如下定义它:

In your csdef define it as follows:

 <Sites>
     <Site name="Web1" physicalDirectory="Web1">
         <VirtualApplication name="Web2" physicalDirectory="Web2"></VirtualApplication>
    </Site>
 </Sites>

这将导致WEB1处于根应用 http://appname.cloudapp.net 和web2是其下的虚拟目录。

That will result in Web1 being the root application at http://appname.cloudapp.net and Web2 being a virtual directory beneath it.

这篇关于使用子路径在一个Web角色托管的两个Web应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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