I am creating a blog engine, and I need a custom route, like this:
localhost/blogname/posts/1
Where blogname should be handled by a BlogsController, and posts will be an action.
How would I define such a route?
I am creating a blog engine, and I need a custom route, like this:
Share
I don’t think you need to define {controller} in your Url if you define it as a constraint. I think this should work:
It might cause problems with other routes though, I’m not sure. If it doesn’t work, David’s answer of http://site.com/blogs/posts/id is the best way to go.