Redirecting CWA 2007 R2 from HTTP to HTTPS in IIS 7
This task has always been more of a pain that it ever should have, regardless of application. After trying a few of the usual hacks like requiring SSL and using a custom error page or an HTTP to HTTPS module I found I still wasn’t having any luck. From what I can tell this is because there actually isn’t any kind of default web page in the CWA virtual directory so when you browse to the HTTP version of the site you actually get a 404 “Page not Found” error before anything else happens.
I ended up keying off that idea and changed the 404 error page to be a redirect to the HTTPS page. I’m still testing this out, but I haven’t run into any issues yet with this approach. To change your site the same way:
- Open IIS 7 Manager.
- Click on the CWA virtual web site you want to redirect.
- Double-click on Error Pages.
- Highlight 404 and press Edit in the right pane.
- Select the Respond with a 302 redirect, enter https://My-CWA-URL and click OK.
- Run a iisreset /noforce for good measure.
I’m curious how this works for everyone and if you see any issues with this method.