locked
Rewriting route parameter RRS feed

Answers

  • User-848649084 posted

    Hi,

    You could try below rule:

    <rule name="rule1" stopProcessing="true">
                        <match url="(.*)/(.*)/(.*)/(.*)/(.*)$" />
                        <conditions>
                            <add input="{QUERY_STRING}" pattern="(.*)" />
                        </conditions>
                        <action type="Redirect" url="https://www.myothersite.com/cptond/api/getfile?id={R:5}&amp;{C:1}" appendQueryString="false" />
                    </rule>

    Regards,

    Jalpa

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Thursday, March 26, 2020 3:16 AM

All replies

  • User-848649084 posted

    Hi,

    You could try below rule:

    <rule name="rule1" stopProcessing="true">
                        <match url="(.*)/(.*)/(.*)/(.*)/(.*)$" />
                        <conditions>
                            <add input="{QUERY_STRING}" pattern="(.*)" />
                        </conditions>
                        <action type="Redirect" url="https://www.myothersite.com/cptond/api/getfile?id={R:5}&amp;{C:1}" appendQueryString="false" />
                    </rule>

    Regards,

    Jalpa

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Thursday, March 26, 2020 3:16 AM
  • User883602251 posted

    Hi Jalpa - thanks so much for responding.

    I should have specified I need it to only intercept the requests that have /DocumentDownload/ in the request url. How would I amend your response to only filter for those requests?

    Thursday, March 26, 2020 11:38 PM
  • User883602251 posted

    Hi Jalpa - I was able to get your code working, it was good.  My issue was that my rules were set to wildcard instead of regex for some reason.  I changed that and it worked. Thanks!

    Friday, March 27, 2020 1:34 AM
  • User-848649084 posted

    Hi,

    If your issue is solved then I request you to mark the helpful suggestion as an answer. This will help other people who face the same issue.

    If your issue still exists then try to refer the solution given by the community members.

    If then also you have any further questions then let us know about it.

    We will try to provide further suggestions to solve the issue.

    Thanks for your understanding.

    Regards

    Jalpa.

    Friday, March 27, 2020 1:36 AM