Monday, 02 May 2011 09:23

Enable HTTP to HTTPS redirection for OWA access

Written by
I understand that there are so many companies still using the exchange 2003 as their messaging solution and are in process of migration to Exchange 2007 or 2010. There could be chances of rebuilding the servers on various reasons and will have to re-do the OWA URL redirection and other respective tasks. Recently I also had encountered to do the same for one of my Exchange 2003 organizations and thought of sharing you the technical details, because it took me some time to figure out various ways out to do the settings.  I have mentioned 2 sections here; one is to redirect the https://mail.exchangedictionary.com request to https://mail.exchangedictionary.com/exchange. Second section will guide you to configure the HTTP traffic redirection to HTTPS.

Simplify the OWA URL:
The steps below will help you to redirect the HTTPS request that is sent to the root of the Web server to the Exchange virtual directory.
  1. Open IIS Manager, and then navigate to Web Sites/Default Web Site. Right-click Default Web Site; and then click Properties.
  2. Click the Home Directory tab, and then click the A redirection to a URL option.
  3. In Redirect to, type /directory name. For example, to redirect https://server name requests to https://server name/exchange, in Redirect to, type /exchange
  4. In the The client will be sent to: list, select A directory below URL entered.

Steps to Enable the Auto Redirection of HTTP to HTTPS:
Now, let us consider how to redirect an HTTP request to HTTPS together with the Exchange virtual directory. The below steps will help you to achieve that as well.

Open Notepad, copy the code below and save it as redirect.htm in the x\inetpub\wwwroot folder. Where 'x' is your IIS installation drive.

<html>
<head> <meta http-equiv="Content-Type" content="text/html;
charset=windows-1252"> <meta http-equiv="refresh"
content="0;url=https://mail.exchangedictionary.com/exchange">
name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId"
content="FrontPage.Editor.Document"> <title></title>
</head>
</html>

Note – replace/modify the mail.exchangedictionary.com with your OWA domain URL.
  1. On the properties of your Default Web Site, go to the Documents Tab. Add redirect.htm to the list of documents, and move it to the top of the list.  This ensures that the server checks for the redirect.htm file first and if it finds it, it will execute it. Otherwise will go further down to execute below solution.
  2. Open up notepad again and paste the following code.  Do not modify it. Save the file as owahttps.asp.
    <%
    If Request.ServerVariables("SERVER_PORT")=80 Then
    Dim strSecureURL
    strSecureURL = "https://"
    strSecureURL = strSecureURL & Request.ServerVariables("SERVER_NAME")
    strSecureURL = strSecureURL & "/exchange"
    Response.Redirect strSecureURL
    End If
    %>
  3. In Windows Explorer, navigate to the wwwroot folder (x:\inetpub\wwwroot where x is the drive IIS is installed) and create a new folder called owaasp. Place the owahttps.asp file into this directory. Once the directory is created, it should show up in IIS admin.
  4. The next step is to modify the Custom error for 403;4 (SSL required).  Go into the properties of the Exchange Virtual Directory, and go to the Custom Errors tab.  Scroll down and find 403;4 and choose Edit Properties. Change the message type to URL and in the URL, type, /owaasp/owahttps.asp.
  5. If the Application Pool is not available, Click the Create button next to Application Name and then you will be able to select the Application Pool.  Once this is configured, requeststo http://servername.domain.com will now be redirected to https://servername.domain.com/exchange
  6. Open a Command Prompt window, and then type iisreset /noforce to restart IIS

Hope this will help you in executing the request step by step.

Note - This is applicable to Exchange 2003.

You may also refer the Technet article, that will help you to configure the other versions of Exchange Server as well.

-Praveen

theme by reviewshub