How to automatically redired all http traffic to https on Exchange 2007




How to automatically redired all http traffic to https on Exchange 2007
Users often don't remember to use https:// when access Outlook Web Access, they simply just use https://. So to automatically redirect them to the same address but with https:// simply follow the below:
 
1) Logon to your exchange server
 
2) Open 'My Computer'
 
3) Navigate to: 'c:\Inetpub\wwwroot'
 
4) You should see two files, 'default.aspx' and 'default.aspx.vb' open them both in notepad and make sure they look like the below (if they don't exist, create them and make sure they are saved under the same names):
 
default.aspx
  1. <%@ Page Language="VB" AutoEventWireup="true" CodeFile="default.aspx.vb" Inherits="login" Debug="true" %>  
  2.   
  3. <html>  
  4. <head>  
  5. </head>  
  6. <body>  
  7. </body>  
  8. </html>  
default.aspx.vb
  1. Imports System.Data   
  2. Imports System.Data.SqlClient   
  3. Imports System.Security.Cryptography   
  4.   
  5. Partial Class login   
  6.     Inherits System.Web.UI.Page   
  7.   
  8.     Public Sub Page_Load()   
  9.         If Not Page.IsPostBack Then  
  10.             BindData()   
  11.         End If  
  12.     End Sub  
  13.   
  14.     Private Sub BindData()   
  15.         If Request.IsSecureConnection Then  
  16.             Response.Redirect("/owa")   
  17.         Else  
  18.             Response.Redirect("https://" & Request.ServerVariables("HTTP_HOST") & "/owa")   
  19.         End If  
  20.     End Sub  
  21.   
  22. End Class  
The important things to remember is that where in my example you see reference to /owa is for Exchange 2007 and earlier versions, if I remember correctly are /exchange or /exhweb, but to check this login to your Outlook Web Access account and take note to the later part of the address.
 
It's also important that in your default.aspx file the option 'AutoEventWireup is set to true, as above.


1 person likes this article, click here to say you like this article too (1)
Send a link to this page via email Send a link to this page