I'm trying to configure my web.config to redirect all the requests to http://sub.sub.domain.com to http://sub.domain.com. My project is hosted in a cloud service in Windows Azure.
Here is what I've tried (but not working).
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect sub.sub.domain.com to sub.domain.com">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}"
pattern="^sub\.sub\.domain\.com$"
negate="true" />
</conditions>
<action type="Redirect"
url="http://sub.domain.com/{R:1}"
redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
Anyone can help?
Thank you very much!