Copied to clipboard

Flag this post as spam?

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


  • Dan Evans 616 posts 988 karma points
    Aug 17, 2015 @ 14:31
    Dan Evans
    0

    Querystring redirect

    I want to redirect all requests to

    /win

    to

    /get-involved/ways-to-give/raffles-lotteries/poppy-lottery/?cfg=PLB&seg=RFZWEBWG2

    But I can't seem to get it to work. If I put the querystring in the old URL it matches this as well so /win/ doesn't work unless it has the QS attached.

    If I put it in the destination URL it redirects without the domain name.

  • Mark Bowser 266 posts 852 karma points c-trib
    Aug 17, 2015 @ 16:10
    Mark Bowser
    0

    So your goal is to redirect from /win to /get-involved/ways-to-give/raffles-lotteries/poppy-lottery/?cfg=PLB&seg=RFZWEBWG2?

    Can you post what you are using for the redirect? If you use the UrlRewriting.config, the url won't actually change. The user will not see the rewritten path, but destination content will be loaded.

    I really like using the IIS Url Rewrite Module for redirects. See Url Rewrite Module documentation. First, you will need to install the Url Rewrite Module on the machines running your site. Then, all you need to do is add this to your web.config:

    <rewrite>
      <rewriteMaps configSource="config/RewriteMaps.config" />
      <!--<rules configSource="config/RewriteRules.config" />-->
    </rewrite>
    

    Then create those two config files. For what you are trying to do here, you shouldn't need the rules. In the 'config/RewriteMaps.config' file, write:

    <rewriteMaps>
      <rewriteMap name="StaticRedirects">
        <add key="/win" value="/get-involved/ways-to-give/raffles-lotteries/poppy-lottery/?cfg=PLB&seg=RFZWEBWG2" />
      </rewriteMap>
    <rewriteMaps>
    

    If you forget to install the Url Rewrite Module on a machine, you will get a really vague configuration error message from IIS, so don't forget to add the rewrite module if you try this.

    Let me know if this helps or if I've missed what you are getting at.

  • Dan Evans 616 posts 988 karma points
    Aug 17, 2015 @ 16:25
    Dan Evans
    0

    My goal is to do all this in the Url Tracker as my editors need to be able to add in these redirects. So the short URL "win" is a landing page, that then takes the user to another page with codes that are tracked.

    I've found a workaround. If I redirect to an alias of my site then it works. The alias is then redirected to the main domain in UrlRewriting.config.

    Thanks

  • 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