创建类似于 Stack Overflow 的“此问题的短永久链接”的短永久链接
我想我可能已经明白这是如何工作的,但想确定一下。
我正在为新的 ASP.NET MVC 应用程序定义路由。我想创建类似于 Stack Overflow 的此问题的短永久链接的短永久链接:
Stack Overflow 为此永久链接使用什么路由和控制器机制行为?
讨论 Stack Overflow 问题路线的其他问题:
I think I might already understand how this works, but wanted to be sure.
I am in the process of defining the routes for a new ASP.NET MVC application. I'd like to create short permalinks similar to Stack Overflow's short permalink to this question:
Create short permalinks similar to Stack Overflow's "short permalink to this question"
What route and controller mechanism is Stack Overflow using for this permalink behavior?
Other Questions discussing Stack Overflow question routes:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信 Stack Overflow 路由的设置与此类似:
基于指向问题当前位置的
302 Found
:我假设 PermaLink 控制器的 Question 操作如下所示:I believe that the Stack Overflow routes are setup something similar to this:
Based on the
302 Found
pointing to the question's current location: I assume the PermaLink controller's Question action looks something like this: