How to specify url mappings in ASP.NET 4.0 when parameters are involved?

troylobster

New Member
The problemI have a web site with some articles inside. Articles are accessed using a database writing results on a single page. When a certain article is to be accessed, I need the article-id and I only need to get to the page: \[code\]http://www.mysite/Articles.aspx?a={article-id}\[/code\].This is nice but not really friendly and not scalable. What I want to do is to redirect every url in the form: \[code\]http://www.mysite/articles/{article-id}\[/code\] to the page \[code\]http://www.mysite/Articles.aspx?a={article-id}\[/code\].I know that using \[code\]Web.Config\[/code\] I can use the \[code\]urlMappings\[/code\] settings, but do not know how to insert a regex there.Some notesPlease consider that I would like to have a simple translation tool. I do not want to edit my existing pages. This solution should be as transparent as possible to my application components.What is the best practice to get to the solution?Thankyou
 
Back
Top