HTTP to HTTPS redirect with Exchange 2013 OWA

exchangeexchange-2013httpsiis-8redirect

I'm trying to set up an automatic redirect from http://webmail.domain.com to https://webmail.domain.com/owa of our Exchange Server 2013 CU1 using the IIS interface.

The old trick to just redirect the Default Web Site or the iisstart.htm redirect only works with https://webmail.domain.com (note that we need to specifiy https). Using only http:// will end up in a 403 Forbidden page for IIS.

The question is: how to setup this correctly so our users can connect in webmail.domain.com and it automatically redirects to https://webmail.domain.com/owa

Thanks,

Best Answer

I was able to solve my own problem using IIS Rewrite Mod. I was little confused when found this, since Rewrite Mod is well know in Unix world with the Apache Web Server.

Anyway, just downloaded and installed the IIS Rewrite Mod from here: http://www.microsoft.com/en-us/download/details.aspx?id=7435

And then modify web.config in wwwroot with this XML code:

<configuration> <system.webServer> <rewrite> <rules> <rule name="HTTPS Redirect" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{HTTPS}" pattern="off" ignoreCase="true" /> </conditions> <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" /> </rule> </rules> </rewrite> </system.webServer> </configuration>

With this approach I was able to redirect HTTP to HTTPS in Exchange 2013.

And don't forget to disable the "Require SSL" option in the Default Web Site on IIS Control Panel or you'll get and 403 Unauthorised error page.