Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 25, 2012 02:42 PM by Mark - MSFT
Member
4 Points
6 Posts
Dec 17, 2012 09:46 AM|LINK
I am successfully using the rewriter with the following code:
<rewrite url="~/cars/(.+).aspx" to="~/cars/findCar.aspx?CarId=${CarName($1)}" />
Now, what I want is to have another rule or to adjust this rule that will allow the following address: ~/cars/
which will display the ~/cars/default.aspx file.
Right now, it gets redirected to the rewriter class and it crashes.
I am looking for an answer either in the regex or in the vb code.
Dec 17, 2012 10:30 AM|LINK
I got my answer elsewhere.
I will post it in case anyone is looking for it.
I added a hard rewrite before the special rule and the key was to add (processing="stop") so it would not continue and be affected by hte second rule.
<rewrite url="~/cars/default.aspx" to="~/cars/default.aspx" processing="stop" /> <rewrite url="~/cars/(.+).aspx" to="~/cars/findCar.aspx?drugId=${CarName($1)}" />
Contributor
7071 Points
435 Posts
Microsoft
Dec 25, 2012 02:42 PM|LINK
Glad this been solved, thank you for sharing it.
yonahs
Member
4 Points
6 Posts
Intelligencia.UrlRewriter regex rewrite not to include a specific page?
Dec 17, 2012 09:46 AM|LINK
I am successfully using the rewriter with the following code:
<rewrite url="~/cars/(.+).aspx" to="~/cars/findCar.aspx?CarId=${CarName($1)}" />Now, what I want is to have another rule or to adjust this rule that will allow the following address: ~/cars/
which will display the ~/cars/default.aspx file.
Right now, it gets redirected to the rewriter class and it crashes.
I am looking for an answer either in the regex or in the vb code.
yonahs
Member
4 Points
6 Posts
Re: Intelligencia.UrlRewriter regex rewrite not to include a specific page?
Dec 17, 2012 10:30 AM|LINK
I got my answer elsewhere.
I will post it in case anyone is looking for it.
I added a hard rewrite before the special rule and the key was to add (processing="stop") so it would not continue and be affected by hte second rule.
<rewrite url="~/cars/default.aspx" to="~/cars/default.aspx" processing="stop" /> <rewrite url="~/cars/(.+).aspx" to="~/cars/findCar.aspx?drugId=${CarName($1)}" />Mark - MSFT
Contributor
7071 Points
435 Posts
Microsoft
Re: Intelligencia.UrlRewriter regex rewrite not to include a specific page?
Dec 25, 2012 02:42 PM|LINK
Glad this been solved, thank you for sharing it.
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework