I am developing a website that has a modular structure. Each URL segment represents a content item. For example, URL: www.mysite.com/blogs/programming/2010/01/
The root element is 'blogs' of type 'area'. He has children's "programming" like "blog".
Now there is "2010/01" to the left of the URL. The last valid (routable) programming element was a blog, so I need to map "2010/01" to action
BlogController.Date (int blogid, int year, int? Month, int? Day)
Each controller comes with a module (separate dll) that registers some types of elements (blog-type registers like βblogβ (routable) and βpostβ (non-routable). βBlogβ can have children of type βpostβ) When the last one is detected valid (routable) element of the URL, the logic knows which assembly and controller to look for. Now I need a way to invoke the correct action with the correct parameters.
Some routes for a blog item
{year} /
{year} / {month}
{year} / {month} / {day}
feed /
category / {category-name} /
tag / {tag-name} /
search / {* phrase}
{* post-name}
Any suggestions what would be an easy way for routing?
source
share