locked
Intelligencia.UrlRewriter regex rewrite not to include a specific page? RRS feed

  • Question

  • User-1021166744 posted

    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.

    Monday, December 17, 2012 5:46 AM

Answers

  • User-1021166744 posted

    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)}" />



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, December 17, 2012 6:30 AM

All replies

  • User-1021166744 posted

    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)}" />



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, December 17, 2012 6:30 AM
  • User-489377026 posted

    Glad this been solved, thank you for sharing it.

    Tuesday, December 25, 2012 10:42 AM