This is a very frequently discussed topic, so much so that I along with other recently asked if something could be built into a future version of Exchange to do this out of the box.
Well after asking another Exchange MVP Pat Richard pointed me to a script that he had written which does all that is needed.
Interestingly there is a little more needed than you might think!
IIS 7 and 7.5 which come with Server 2008 and Server 2008 R2 respectively both have a redirect feature which is used as part of Exchange client access to provide for legacy clients.
We can make use of it to allow for OWA redirect from the root site however that requires a bunch of SSL changes. We must turn off the requirement for SSL on the root site to allow the redirect of http://mail.domain.com to https://mail.domain.com/owa.
However doing that in the GUI for the root of the site will also uncheck the require SSL for a bunch of sub-sites (like OWA)! Not what we want at all. Clearly you can go through a manually set things how they should be but using the script Pat provides it is all done for you!
One final thing the script does is set permissions on the OAB web.config file which is created as part of the redirect process.
Oh, and finally it takes a backup before it starts!
To get the script look at Pats blog post here.
For a lot more info on the redirect subject in general including more on the Offline Address Book (OAB) problem check out Henrik’s post here:
So having done this anyone hitting the default website of the CAS server will be redirected to the correct URL.
Finally, in a future post I will investigate how this might change when publishing with ISA/TMG.