【问题标题】:ASP.NET MVC Url Masking/RewritingASP.NET MVC Url 屏蔽/重写
【发布时间】:2011-02-16 10:15:07
【问题描述】:

假设我有一个 subdomain.domain.com 的 URL。在 ASP.NET MVC 中是否有一种方法可以让您使用 otherdomain.com/gotothesubdomain 的 URL 将您带到 subdomain.domain.com?我知道一个简单的重定向可以做到这一点,但我希望 url 保持为 otherdomain.com/gotothesubdomain。

任何建议将不胜感激并感谢!

【问题讨论】:

    标签: asp.net-mvc url-rewriting cross-domain


    【解决方案1】:

    假设您有 2 个单独的应用程序,那么您需要将页面作为字符串抓取然后呈现,这里有一些潜在的起点 - WebRequest/WebResponse,mvc 源中的 Html.RenderPartial 或者您可以看看在JoeyB's 文章。

    查看 Luke Sampsons 文章可能会有所帮助,该文章解释了如何在一个 mvc 应用程序中拥有多个子域,可能对您的方案有所帮助?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-04-08
      • 2011-08-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-29
      • 2014-07-13
      相关资源
      最近更新 更多