Copied to clipboard

Flag this post as spam?

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


  • Gilles Faessler 29 posts 53 karma points
    Jan 27, 2016 @ 11:00
    Gilles Faessler
    0

    Url rewriting remove querystring

    I am trying to configure a simple rewrite rule using urlrewriting.net but I can't get it to work. Any help would be appreciated.

    The goal is to 301 redirect all requests from http://www.xxx.com/1726.aspx with any query string behind to the exact following url : http://www.xxx.com/newurl/ using urlrewriting.net :

    I created the rule below :

    <add name="301 redirect"
    virtualUrl="^http://www.xxx.com/1726.aspx(.*)"
    rewriteUrlParameter="ExcludeFromClientQueryString"
    destinationUrl="http://www.xxx.com/newurl/"
    redirect="Domain"
    redirectMode="Permanent"
    ignoreCase="true" />        
    

    The problem is that my querystring is kept at the end of the destination url. For example "http://www.xxx.com/1726.aspx??tag=blue&type=3" becomes " http://www.xxx.com/newurl/?tag=blue&type=3".

    I would like to remove the part "?tag=blue&type=3" on destination url. How can I do that ?

  • Jeroen Breuer 4909 posts 12266 karma points MVP 5x admin c-trib
    Jan 31, 2016 @ 16:59
    Jeroen Breuer
    0

    Hello,

    Do you know about the UrlProvider and ContentFinder? Those might be better to use. See this blog for more info: http://24days.in/umbraco/2014/urlprovider-and-contentfinder/

    Jeroen

  • 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