Copied to clipboard

Flag this post as spam?

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


  • MartinB 411 posts 512 karma points
    Aug 17, 2011 @ 11:55
    MartinB
    0

    Rewrite url with parameters

    Hi there

    I've just published a new site for a client, where the old site had a lot of urls with parameters indexed.

    I wan't to 301 redirect those where possible, but with my current rule i still end up with the id in the new url :/

    Example:

    www.mysite.com/showItem.php?item_id=123&type=test

    I then rewrite like this:

    <add name="301redirect17"
    redirect="Domain"
    ignoreCase="true"
    rewriteUrlParameter="ExcludeFromClientQueryString"
    virtualUrl="http://www.mysite.com/showItem.php?(.*)$"
    redirectMode="Permanent"
    destinationUrl="http://www.mysite.com/newpage.aspx" />

    This lands me the url of:

    www.mysite.com/newpage.aspx?item_id=test

    I get the correct page, but clearly i want the parameters excluded. How to go about this? I've searched the forums and google for a while and can't seem to find an example on how to do this with urlrewrite rules as the one above.

    Any help is highly appreciated!

  • MartinB 411 posts 512 karma points
    Sep 06, 2011 @ 21:01
    MartinB
    0

    Anyone?

  • Lennart Stoop 304 posts 841 karma points
    Sep 06, 2011 @ 23:16
    Lennart Stoop
    0

    Hey Martin,

    I'm not entirely sure about this but does it help replacing virtual URL with "http://www.mysite.com/showItem.php" ?

     

    Grtz

    L

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies