I'm stuck with redirecting for specific domains. The setup consists of azure webapps which bring their own domain *.azurewebsites.net
, I want to exclude those from redirecting. For additional domains e.g. example.com I need to redirect
- to https
- to www
- and no redirection if I enter the correct address
https://www.example.com
Edit: I use deployment slots, so I want the same web.config to work when I swap a slot in production.
When I tried to use more than one rule, unfortunately I get server or redirect errors. Should I learn regex better? Here is my first rule to exclude the "internal" domains, but that is already not working:
<rule name="ignore azure" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^azurewebsites\.net$" />
<add input="{HTTPS_HOST}" pattern="^azurewebsites\.net$" />
</conditions>
<action type="none" />
</rule>
I have read the 30 first posts on google but none of those exclude another domain name.