【发布时间】:2016-09-01 23:04:56
【问题描述】:
这是我的问题。我需要两件事:
我需要设置一个子域(sub.example.com) 以从http://example.com/somepath 加载其内容,但URL 需要为用户保留(sub.example.com)。这将使http://example.com/somepath/someotherpath 等同于sub.example.com/someotherpath 等等......
如果用户直接访问http://example.com/somepath,我要么需要将他重定向到子域,要么只重写URL。
我正在使用托管在 Azure 上的 MVC Web 应用程序。
我不擅长写重写规则。因此,如果有人可以帮助我,如果这是可能的,我需要在我的 web.config 文件中输入什么重写规则来实现这一点。或者也许有更好的方法。
谢谢。
【问题讨论】:
标签: asp.net-mvc azure url-rewriting web-config url-redirection