« Previous Next »

Thread: Redirecting one dynamic URL to another

Last post 10-13-2008 4:13 PM by ruslany. 1 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 10-13-2008, 3:06 PM

    Redirecting one dynamic URL to another

    I'm trying to setup a redirect from this:
    http://www.contoso.com/buying/search/details.aspx?id=2538244

    to this:
    http://www.contoso.com/Search.aspx?mls=2538244

    and I can't seem to get it to work - any ideas?

  • 10-13-2008, 4:13 PM In reply to

    • ruslany
    • Top 25 Contributor
    • Joined on 07-01-2007, 3:38 PM
    • Redmond, WA
    • Posts 661

    Re: Redirecting one dynamic URL to another

    One thing to check is how your rule evaluates the query string. Note that the query string is not evaluated by the rule's pattern, instead it should be evaluated in a rule's condition by using {QUERY_STRING} server variable, e.g.:

     <rule name="redirect" stopProcessing="true">
                        <match url="^buying/search/details\.aspx$" />
                        <conditions>
                            <add input="{QUERY_STRING}" pattern="^id=([0-9]+)$" />
                        </conditions>
                        <action type="Redirect" url="Search.aspx?mls={C:1}" redirectType="Permanent" />
     </rule>

     

    http://ruslany.net
Page 1 of 1 (2 items)
Microsoft Communities