Intelligencia URL ReWriter mapping with regex

Posted by alex on Stack Overflow See other posts from Stack Overflow or by alex
Published on 2010-03-25T20:18:29Z Indexed on 2010/03/25 20:23 UTC
Read the original article Hit count: 739

Filed under:
|
|

I am using the Intelligencia URL rewriter in my asp.net web application. I use the web.config mappings

I'm trying to map the following url:

www.mydomain.com/product-deals/manufacturer-model_PRODUCTId.aspx

To:

www.mydomain.com/ProductInfo.aspx?productID=xxx

obviously in the above example, xxx is replaced from the "productId" from the "friendly" url.

In my web.config, I've got so far:

<rewrite url="~/contract-deals/([\w-_]+)/_(.+).aspx" to="~/ProductInfo.aspx?productId=$1"/>

This isn't working however.

I need the correct regex to use for my requirements (regex really isn't my strong point!!)

© Stack Overflow or respective owner

Related posts about url-rewriting

Related posts about ASP.NET