1

I would like to redirect testdomain.com/diamonds/silver to testdomain.com/diamonds.

I need to have the domain specified because the website has several domains attached to it.

This is what i have now, but it does not seem to do anything.

<rule name="testredirect" stopProcessing="true">
        <match url=".*" />
         <conditions logicalGrouping="MatchAny">
           <add input="{HTTP_HOST}" pattern="^testdomain.com/diamonds/silver" />
         </conditions>
         <action type="Redirect" url="/diamonds" redirectType="Permanent" />
 </rule>

I have also tried this, but that did not work either.

<rule name="testredirect" stopProcessing="true">
    <match url="^testdomain.com/diamonds/silver" ignoreCase="true" />
    <action type="Redirect" url="/diamonds" redirectType="Permanent"/> 
</rule>

Any suggestions?

I have figured it out. Answer below!

2
  • Do you have different deployments for each domain? In this case I would suggest to solve this with web.config tranformations: msdn.microsoft.com/en-us/library/dd465326(v=vs.110).aspx Commented Jun 26, 2017 at 7:43
  • No, same deployment. Commented Jun 26, 2017 at 7:44

1 Answer 1

4

Finally.

This worked:

<rule name="redirect diamonds" stopProcessing="true">
            <match url="^diamonds/diamondrings" ignoreCase="true" />
            <conditions>
                <add input="{HTTP_HOST}" pattern="^(www.)?mywebshop.azurewebsites.net" />
            </conditions>
            <action type="Redirect" url="/diamondrings" redirectType="Permanent" />
        </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.