title: c# URL Rewrite - Same pattern with different page targets
body: <p>How to rewrite in asp.net webforms same pattern urls to different pages, mapping from database?
  I have the following URLs:</p>
  
  <p>www.site.com/categoryname (redirect to category.aspx?name=categoryname
  www.site.com/categoryname/2 (redirect to category.aspx?name=categoryname&amp;page=2
  www.site.com/categoryname/filtername (redirect to category.aspx?name=categoryname&amp;filter=filtername)
  www.site.com/categoryname/productname (redirect to product.aspx?name=productname)
  www.site.com/brandname (redirect to brand.aspx?name=brandname)</p>
  
  <p>So, the pattern of brand/category single pages are the same, also the pattern for category/product and category/filter are the same. In IIS rewrite I can't do this, because I can't "predict" what is the right page. There is any way to lookup at a database table to redirect to the right page and handle specific cases that I dont need to lookup the database (like example with pagination, just the first part will be in database and I need to know that the user is in page 2)</p>
  
  <p>Thanks!</p>