子应用程序路径的问题

时间:2013-06-14 11:23:12

标签: c# asp.net iis-7

我在IIS中创建了一个名为wbsite1的新网站。然后我向website1添加了一个应用程序,它是一个名为website2的网站。当我们尝试访问website2中的链接时出现问题。浏览器总是引用根网址并重定向,因此我们尝试更改网站2中的所有网址。例如,如果我们在website2中有一个url,如:

<a href='http://localhost:2030/website2/cms/default.aspx...'

我们点击该链接,浏览器将我们重定向到:

http://localhost:2030/website1/default.aspx

为什么我会出现这种行为?什么是集成两个网站而不试图弄乱网站中每个链接的最佳解决方法?非常感谢你。

enter image description here

我试图访问子应用程序中的页面时,我们遇到了麻烦它重定向到主应用程序的默认页面并给出错误:

  

会话状态在此上下文中不可用。

1 个答案:

答案 0 :(得分:1)

我找到了问题的解决方案,就是这样:

 unfortunately i have to "rewrite" all our links in my code. 
 so  i created a function which will automatically add prefix to external links,
 and store base link for other site it configuration. 
 I did such project with success.  thank u for all your replies 

我发现了另一种解决方案,它使用的是Web代理,但我不能在我的场景中使用它