views:

118

answers:

4

I am getting the error System.Web.HttpException: Path 'OPTIONS' is forbidden. since we moved our website over to a new server setup. I am unable to recreate the error but I am receiving emails for this exception at least a few times a day. Any ideas what could be causing this and how I can fix it?

EDIT: Stack Trace:

at System.Web.HttpMethodNotAllowedHandler.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

There are no directories or files named OPTIONS and I believe all permissions are correct. I am finding some information about a possible link to EXCEL getting data from the webserver, but nothing that full explains how or what is happening yet.

EDIT AGAIN: Seems this has to do with Excel files opening in Internet Explorer..

+1  A: 

This is probably permissions on your system. To get a little more detail, the search term to google up is "Path is forbidden" -- the OPTIONS part is a string that is specific to your application.

Better yet, rack your brain a little and try to think of a part of your application that attempts to access a URL or file path with that name.

Paul
Oops, I think I have to correct myself. It looks like it's referring to an HTTP verb named OPTIONS. See the following knowledgebase article: http://msdn.microsoft.com/en-us/library/bya7fh0a.aspx It looks like you should be able to resolve this through changes in configuration.
Paul
A: 

You might also consider putting in elmah. That way you can get the full error details when it does happen.

Chris Lively
A: 

Are you getting any user error reports or similar. OPTIONS is an http verb that is used to find outthe capabilities of the server. It sounds like your new web server is not configured to allow this verb, probably for security reasons. A normal web request from a browser would not use this verb and it is often used by malware/bots scanning web servers for vulnerabilities to exploit.

Ben Robinson
A: 

OPTION is a verb used by "Microsoft Data Access Internet Publishing Provider Protocol Discovery" (Part of MS Office) to make request when a user opens a URL from inside office applications.

You should be able to re-create the issue by going File>Open in Word/Excel 2003 and above and specifying the full URL of the file. Alternatively by placing a link to an excel file on your server in an office document and clicking it.

You can fix it by adding this to your web.config file with additional lines for each file type:

<httpHandlers>
  <add verb="*" path="*.xls" type="System.Web.StaticFileHandler" />
  <add verb="*" path="*.xlsx" type="System.Web.StaticFileHandler" />
</httpHandlers>
John