1-888-365-2779
+1-888-365-2779
Try Now
More in this section

URL rewrite

2 posts, 0 answered
  1. Brian
    Brian avatar
    1 posts
    Registered:
    02 Nov 2007
    10 Mar 2008
    Link to this post
    Is it possible to have the rewrite rule with a query string containing multiple params?  For example, I want to set up:

          <rule>
            <url>/MyURL/(.*)/(.*)/\.aspx</url>
            <rewrite>/MyURL/directory.aspx?param1=$1&param2=$2</rewrite>
          </rule>

    ... but it doesn't like the "&" within the rewrite tag.  It gives a warning message saying "Expecting ';'."

    Thanks.
  2. Sonya
    Sonya avatar
    231 posts
    Registered:
    24 Sep 2012
    12 Mar 2008
    Link to this post
    Hi Brian,

    You need to substitute the ampersand symbol "&" with its entity name: "&amp;". The following code should be the result:

    <rule> 
        <url>/MyURL/(.*)/(.*)/\.aspx</url> 
        <rewrite>/MyURL/directory.aspx?param1=$1&amp;param2=$2</rewrite> 
    </rule> 

    Hope this helps.


    Sincerely yours,
    Sonya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
2 posts, 0 answered