Copied to clipboard

Flag this post as spam?

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


  • Graham Carr 277 posts 389 karma points
    Oct 31, 2012 @ 15:25
    Graham Carr
    0

    URL Rewriting

    I am adding re-writing rules to the UrlRewriting.config file. One of the rules I need to do is as follows:

    /products/cold-cathode.aspx

    needs to be rewritten to

    /products/product-list.aspx?cat=cold-cathode

    The rule I am using is as follows:

    <add name="ColdCathode"
      virtualUrl="^~/products/(.*).aspx$"
      rewriteUrlParameter="ExcludeFromClientQueryString"
      destinationUrl="~/products/product-list.aspx?cat=$1"
      ignoreCase="true"
    />

    This seems to be working, but instead of the user still seeing /products/cold-cathode.aspx the user is instead seeing the destinationUrl. How do you ensure that the original URL is still shown but the destination page is as specified.

Please Sign in or register to post replies

Write your reply to:

Draft