Last post May 21, 2009 01:37 PM by rtpHarry
May 21, 2009 11:52 AM|alexjamesbrown|LINK
im using UrlRewriter.net to do my URL Rewriting.
What i have currently is:
in the web.config, i have this mapping:
<rewrite url="~/phones/(.+).aspx" to="~/PhoneInfo.aspx?phoneName=$1" />
Simple. This works, and is ok....
but, ideally i want to be able to do:
so basically, the first / after /phones/ is the manufacturer, the second is the model.
<rewrite url="~/phones/(.+)/(.+).aspx" to="~/PhoneInfo.aspx?manufacturer=$1&model=$2" />
But it didnt work...
Any idea where im going wrong??
May 21, 2009 01:37 PM|rtpHarry|LINK
What did you get as the end url?
<rewrite url="~/phones/([\w-_]+)/(.+).aspx" to="~/PhoneInfo.aspx?manufacturer=$1&model=$2" />
That should only match a letter, a dash, or an underscore.
Regular expressions are greedy by default so they would match as much as possible given the chance.