Asp.net MVC 自定义路由与 SEO
routes.MapRoute(
"Route",
"{id}/{*seostuff}",
new {controller = "Home", action="Index", seo = UrlParameter.Optional});
这将允许您映射网址,例如 http ://www.somesite.com/11/whatever/goes-here/will-be-whatever-you/want
这是原始帖子Asp.net MVC 自定义路由
大家好!
-我想知道这是如何在控制器中编写代码?我有一个像 Product/Phone/i-phone.aspx 这样的静态页面,它位于产品下,它有一个文件夹电话...大家有什么建议吗?非常感谢.. 。
routes.MapRoute(
"Route",
"{id}/{*seostuff}",
new {controller = "Home", action="Index", seo = UrlParameter.Optional});
that will allow you to map urls such as http://www.somesite.com/11/whatever/goes-here/will-be-whatever-you/want
Here is the original post Asp.net MVC custom routing
Hi guys!
-what I want to know is how can this be code in controller? I have a static page like this Product/Phone/i-phone.aspx which is under the product it has a folder phone.. . any suggestion guys? thank you very much.. .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以定义您所描述的路线...
我个人更喜欢在网址开头有一个关键字,因为这会给您一个额外的关键字(例如 www.keywords.com/keywords )并允许将来添加到该网站...
You can define the route you have described...
I personally prefer to have a Keyword at the start of the url as this gives you an additional keyword (eg www.keywords.com/keywords )and allows future additions to the site...