【发布时间】:2013-01-31 16:51:44
【问题描述】:
我在 global.asax 中定义了以下路由路径来处理 url 中的两个参数:
routes.MapRoute(
"Default", // Route name
"{page}/{th}", // URL with parameters
new { controller = "Home", action = "Index", page = UrlParameter.Optional, th = UrlParameter.Optional } // Parameter defaults
);
第一个参数是另一个网站的URL,即www.othersite.com/about/。
即使我将斜杠编码为 %2f,它也无法正确路由 URL。我想使用这样的东西:
http://{mywebsite}/www.othersite.net%2fabout%2f/{parameter2}
我不想使用 Base64 编码,因为我希望 URL 像上面那样可读。
我正在使用 MVC 3。
谢谢
【问题讨论】:
标签: asp.net-mvc-3 url-rewriting url-routing