title: How to exclude Azure slots from IIS Redirect Rule
body: <p>I have a website hosted by Azure , I have 2 slots main and staging. I wrote a condition for redirecting non-www to www like following:</p>
  
  <pre><code> &lt;rule name="WWW Rewrite" enabled="true"&gt;
        &lt;match url="(.*)" /&gt;
        &lt;conditions&gt;
          &lt;add input="{HTTP_HOST}" negate="true" pattern="^www\." /&gt;
        &lt;/conditions&gt;
        &lt;action type="Redirect" url="https://www.{HTTP_HOST}/{R:0}" appendQueryString="true" redirectType="Permanent" /&gt;
      &lt;/rule&gt;
  </code></pre>
  
  <p>My problem is this rule is applying also for the staging slot, like if I typed <a href="https://mydomain-staging.azurewebsites.net" rel="nofollow noreferrer">https://mydomain-staging.azurewebsites.net</a> it redirect me to <a href="https://www.mydomain-staging.azurewebsites.net" rel="nofollow noreferrer">https://www.mydomain-staging.azurewebsites.net</a> so I couldn't test my staging slot !.</p>
  
  <p>I need to write a rule to exclude my slots which ends with <code>azurewebsites.net</code> </p>
  
  <p>I followed <a href="https://stackoverflow.com/questions/28971357/azure-cloud-service-ssl-redirect-from-staging-to-production-slot">this</a> answer but it didn't work for me.</p>