开发者

ASP.NET MVC Url Masking/Rewriting

开发者 https://www.devze.com 2022-12-29 03:59 出处:网络
Let us say I have a url of subdomain.domain.com.Is there a way in ASP.NET MVC to have a url of say otherdomain.com/g开发者_如何学运维otothesubdomain that takes you to subdomain.domain.com?I know that

Let us say I have a url of subdomain.domain.com. Is there a way in ASP.NET MVC to have a url of say otherdomain.com/g开发者_如何学运维otothesubdomain that takes you to subdomain.domain.com? I know that a simple redirect could do it, but I want the url to stay as otherdomain.com/gotothesubdomain.

Any advice would be greatly appreciated and thanks!


Assuming that you have 2 separate applications then you would need to grab the page as a string and then render it, here are some potential starting points - WebRequest/WebResponse, Html.RenderPartial in the mvc source or you could have a look at JoeyB's article.

It may be helpful to look at Luke Sampsons article that explains how to have multiple sub-domains in one mvc application, may help with your scenario?

0

精彩评论

暂无评论...
验证码 换一张
取 消