IIS 7.5无法以ASP.Class运行* .inc [英] IIS 7.5 doesn't run *.inc as ASP Classic

查看:60
本文介绍了IIS 7.5无法以ASP.Class运行* .inc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Win7 x64上建立一个ASP Classic网站,我已经完成了通常的技巧(将站点添加为Application以启用global.asa,使用Classic管道App Pool,启用32位应用程序:True,加载用户配置文件:错误,启用父路径:正确,授予所有人对站点文件的完全访问权限,使用odbc 32),并且该站点已启动并正在运行* .asp文件.但是,我在Includes目录下有一些名为* .inc的文件,而IIS似乎无法处理它们.

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.

当我尝试访问 http://localhost//includes/myfile.inc时,我得到了:

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

HTTP错误404.3-找不到 由于扩展程序配置的原因,无法提供您请求的页面.如果页面是脚本,请添加处理程序.如果应下载文件,请添加一个MIME映射.

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.

我试图在Handler Mapping中添加一个脚本映射,类似于* .asp的脚本映射:Request Path = * .inc,Executable =%windir%\ system32 \ inetsrv \ asp.dll,仅当请求为映射到文件,并且在有序列表中,此新映射位于最上面.现在,当请求.inc时出现此错误:

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错误404.17-未找到 请求的内容似乎是脚本,不会由静态文件处理程序提供.

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

有什么想法吗?

推荐答案

为什么要尝试在浏览器中加载.inc文件?这是不正常的行为.这些文件应包含在其他文件中,例如ASP.

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.

阻止这些文件被请求可以保护您免于泄露源代码,而如果IIS确实为这些文件提供服务,则将发生这种情况.只会输出其内容的详细信息.

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.

这篇关于IIS 7.5无法以ASP.Class运行* .inc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆