ASP.NET MVC 自定义 URL - 虚拟服务器路径

发布于 2024-07-29 22:35:40 字数 456 浏览 3 评论 0原文

我知道如何设置像 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

疑心病 2024-08-05 22:35:40

查看这篇关于同一件事的博客文章。 作者 (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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文