ASP.NET MVC 自定义 URL - 虚拟服务器路径
我知道如何设置像 http://siteurl.com/mycustomaccount/dashboard 这样的网址的路由,但我想使用自定义虚拟服务器路径自定义“url”部分,例如 http://mycustomaccount。 siteurl.com/dashboard。
我希望注册的用户能够设置其帐户“mycustomaccount”,以便我可以拦截请求并提供适当的帐户信息。 这对我或用户来说并不是很重要,但这是一个很好的功能。
如何设置我的路线图以及我是否可以在服务器上没有物理文件夹的情况下设置帐户?
I know how to setup a route to a url like http://siteurl.com/mycustomaccount/dashboard, but I would like to customize the "url" portion with a custom virtual server path such as http://mycustomaccount.siteurl.com/dashboard.
I want users signing up to have their account "mycustomaccount" setup so that I can intercept the request and provide the appropriate account information. This is not very important to me or the users, but is a nice to have feature.
How do I setup my route map and can I setup the account without a physical folder on the server?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看这篇关于同一件事的博客文章。 作者 (Maarten Balliauw) 还在文章末尾的 zip 文件中提供了代码。
http://blog.maartenballiauw.be/帖子/2009/05/20/ASPNET-MVC-Domain-Routing.aspx
Check out this blog post about the same thing. The author (Maarten Balliauw) also provides the code in a zip file at the end of the article.
http://blog.maartenballiauw.be/post/2009/05/20/ASPNET-MVC-Domain-Routing.aspx