4

We are using the Sitecore Azure Module to deploy to CD delivery farms. We want to use an IIS Rewrite Rule to redirect all traffic on CD to SSL - however, we do not want the same rule applied on CM (which is our on-premise server from which we push our site to Azure via the Azure Module).

When using the Azure module, CM and CD share config files. Is there a way for us to drop a re-write rule into the web.config that will ONLY be applied to CD, and not to CM? Or some kind of alternative equivalent?

5

Your CM and CD servers are available by different addresses.(e.g.: cms.test.com and www.test.com)

It is possible to filter redirect rule before execution using {HTTP_HOST} variable:

<rule name="Force SSL" stopProcessing="true">
  <match url="(.*)" />
  <conditions logicalGrouping="MatchAny">
    <add input="{HTTP_HOST}" pattern="yourCDaddress1" />
    <add input="{HTTP_HOST}" pattern="yourCDaddress2" />
  </conditions>
  <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
</rule>

where yourCDaddress1, yourCDaddress2, etc. your CD addresses, e.g.: www.test.com, test.com, etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.