Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Sean Dooley 289 posts 528 karma points
    May 28, 2014 @ 10:47
    Sean Dooley
    0

    UrlRewriting - same page, different querystring parameters

    Looking for some help with setting up al UrlRewrite for the same page with different querystring parameters.

    Below are the two urls that I am looking to rewrite

    stockists.aspx?product=1&fragrance=2
    stockists.aspx?store=1

    I setup the url rewrite for stockists.aspx?product=1&fragrance=2 (in config/UrlRewriting.config) first and tested successfully.

    <add name="Stockists"
    virtualUrl="^~/stockists/(.*)/(.*).aspx"
    rewriteUrlParameter="ExcludeFromClientQueryString"
    destinationUrl="~/stockists.aspx?product=$1&amp;fragrance=$2"
    ignoreCase="true" />

    I then setup the url rewrite for stockists.aspx?store=1 (in config/UrlRewriting.config) and now neither url rewrite works.

    <add name="Stores"
    virtualUrl="^~/stockists/(.*).aspx"
    rewriteUrlParameter="ExcludeFromClientQueryString"
    destinationUrl="~/stockists.aspx?store=$1"
    ignoreCase="true" />

    Any suggestions on how the above can be achieved?

Please Sign in or register to post replies

Write your reply to:

Draft