Small Update to Redirection Blog

Last week, I posted about how to redirect HTTP connects to Exchange 2010 OWA to HTTPS. There was a small issue in the post which I’ve now corrected. If you explicitly disabled HTTP Redirection for the OWA virtual directory, you would break the /exchange, /public, and /exchweb virtual directories which redirect to /owa.

If you browse to https://owa.customer.com/exchange, you might see the following event in the Application log of your CAS server:

Log Name:      Application
Source:        ASP.NET 2.0.50727.0
Date:          1/31/2010 2:20:16 PM
Event ID:      1310
Task Category: Web Event
Level:         Warning
Keywords:      Classic
User:          N/A
Computer:      CAS01.green.briandesmond.net

Description:
Event code: 3008
Event message: A configuration error has occurred.
Event time: 1/31/2010 2:20:16 PM
Event time (UTC): 1/31/2010 10:20:16 PM
Event ID: 1dd0ff95241040a48b5acc09bff2e3ad
Event sequence: 32
Event occurrence: 31
Event detail code: 0 
Application information:    
Application domain: /LM/W3SVC/1/ROOT-2-129092586348966635    
Trust level: Full    
Application Virtual Path: /    
Application Path: C:\inetpub\wwwroot\    
Machine name: CAS01
Process information:    
Process ID: 2268    
Process name: w3wp.exe    
Account name: IIS APPPOOL\DefaultAppPool 
Exception information:    
Exception type: ConfigurationErrorsException    
Exception message: It is an error to use a section registered as allowDefinition=’MachineToApplication’ beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS. (C:\Exchange\ClientAccess\owa\web.config line 31) 
Request information:    
Request URL: http://localhost/exchange/default.aspx    
Request path: /exchange/default.aspx    
User host address: 127.0.0.1    
User:     
Is authenticated: False    
Authentication Type:     
Thread account name: IIS APPPOOL\DefaultAppPool 
Thread information:    
Thread ID: 19    
Thread account name: IIS APPPOOL\DefaultAppPool    
Is impersonating: False    
Stack trace:   
   at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
   at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
   at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
   at System.Web.Configuration.RuntimeConfig.GetSectionObject(String sectionName)
   at System.Web.Configuration.RuntimeConfig.GetSection(String sectionName, Type type, ResultsIndex index)
   at System.Web.Configuration.RuntimeConfig.get_Identity()
   at System.Web.HttpContext.SetImpersonationEnabled()
   at System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)

To resolve this, open the web.config file for OWA. The path is in the event. I highlighted it in red boldface font above so you know where to look. Inside of the web.config file, search for and remove this line:

<httpRedirect enabled="false" />

Warning: Improperly editing the web.config file for OWA could render it entirely inoperable. I highly recommend that you save a backup prior to making any changes to the file.

Leave a Reply

Your email address will not be published. Required fields are marked *