views:

29

answers:

1

Hi,

I'm setting up an ASP Classic website on Win7 x64, I have done the usual trick (Add site as Application to enable global.asa, use Classic pipeline App Pool, Enable 32-bit Applications: True, Load User Profile: False, Enable Parent Paths: True, give Everyone full access to site files, use odbc 32), and the site is up and running for *.asp files. However, I have some files named as *.inc under Includes directory, and IIS doesn't seem to be able to process them.

When I try to access http://localhost//includes/myfile.inc, I got:

HTTP Error 404.3 - Not Found The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.

I tried to add a script map in Handler Mapping, similar to the one for *.asp: Request Path = *.inc, Executable = %windir%\system32\inetsrv\asp.dll, Invoke handler only if request is mapped to File, and in the ordered list this new mapping is on top. Now I got this error when request .inc:

HTTP Error 404.17 - Not Found The requested content appears to be script and will not be served by the static file handler.

Any ideas?

+2  A: 

Why are you trying to load .inc files in the browser? This is not normal behavior. Those files are meant to be included in other files, such as the ASPs.

Blocking those files from being requested is protecting you from revealing your source code, which is what would happen if IIS did serve those files; it would just output their contents verbatum.

Andrew Barber
Good point, I should go for a MIME map instead.
su27k
**No**, you should **absolutely not** do that. INC files are supposed to be *server-side* include files. By default, IIS7.x handles them 100% correctly once you have ASP working properly itself. If you are using these INC files as *client-side* includes, you should rename them to something more appropriate. But you should *never* enable server-side code files to be downloaded by the client, which is what adding a MIME map for them may end up doing.
Andrew Barber