OWA redirect

Performing redirects to the /OWA directory is something most Exchange Admins have come across. Nicolas Blank covers it in his blog, Redirecting from / to /owa, perfectly.

Simple, create a text file called “default.asp” and place it in the virtual directory that is handled by webmail.domain.com and place the following code inside it. Just Remember to replace domain.com with your own domain name.

<html>
<head>

<meta http-equiv="REFRESH" content="0;url=https://webmail.domain.com/owa">

/head>
</html>

There can be problems using Meta REFRESH (see here), so with Safari and Firefox Premium OWA support in Exchange 2010 we should use JavaScript for the best experience.
We may also want to setup a HTTP to HTTPS redirect for those users who do not type “https://…”.

<html>
<head runat="server">
<title>Outlook Web Access</title>
<script language="javascript" type="text/javascript">
function redirect()
{
    var URL;
    var Protocol;
    var Path;
    // this will be whatever is in the browser. If you need to change this then comment out relevant line below
    // Protocol = window.location.protocol + "//"
    // Protocol = "
http://"
    Protocol = "https://"
    Path = window.location.hostname + window.location.pathname + "owa"
    window.location.href = Protocol + Path
}

</script>
</head>
<body onload="redirect()">
</body>
</html>

For best results set the root of the web site not to require SSL and all virtual directories (OWA, EWS, etc) to require SSL.

Daniel
twitter.com/dannoakes

3 comments:

  1. Hi Dan,

    Just posted an article myself earlier this month with OWA redirection using ISA which can be accessed here;
    http://www.gk.id.au/2009/06/outlook-web-access-redirection-via.html

    Feel free to post back to your method for those not using ISA from my article.
    ReplyDelete
  2. Aw, this was a really quality post. In theory I'd like to write like this too – taking time and real effort to make a good article… but what can I say… I procrastinate alot and never seem to get something done.
    ReplyDelete
  3. I've bookmarked your site and will visit it often and thanks for sharing this wonderful information.
    ReplyDelete