2

I am trying to redirect from one site to another like the following.

http://example.com/quickscan/?code=123456 

To

https://example2.com/as-quickscan/login?username=123456

The domains are different. Also the redirect URL parameter and URL structure is entirely different.

What I have tried is the following and some other variations.

<rule name="Redirect quickscan" stopProcessing="true">
  <match url="^quickscan/\?[a-zA-Z]+=([0-9]+)?$" ignoreCase="true" />
  <action type="Redirect" url="https://example2.com/as-quickscan/login?username={R:1}" appendQueryString="false"/>
</rule>
<rule name="Redirect quickscan" stopProcessing="true">
    <match url="^(.*)$" ignoreCase="false" />
    <conditions>
        <add input="{QUERY_STRING}" pattern="^quickscan/\?[a-zA-Z]+?=([0-9]+)?$" />
    </conditions>
    <action type="Redirect" url="https://example2.com/as-quickscan/login?username={R:1}" redirectType="Permanent" appendQueryString="false" />
</rule>

1 Answer 1

2

This is fixed. I used the following.

<rule name="Redirect quickscan" stopProcessing="true">
    <match url="^quickscan/" ignoreCase="false" />
    <conditions>
        <add input="{QUERY_STRING}" pattern="([a-z]+)=([0-9]+)" />
    </conditions>
    <action type="Redirect" url="https://example2.com/as-quickscan/login?username={C:2}" appendQueryString="false" />
</rule>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.