我有一个较旧的经典ASP网站,我正在迁移到IIS7.5。我不想在服务器上安装经典的ASP,所以我只想让.asp文件被视为.aspx文件。
如何做我在IIS7.5中这样做?
编辑:为了澄清,我不是要求如何获得经典的ASP代码在.Net下工作。我只是问如何映射.ASP文件扩展名由运行时处理。我将把.asp文件中的代码升级到。
编辑:
我放弃了并安装经典的ASP,因为我无法使映射工作(收到404.17和404.3错误的组合)。我标记了David Lively的答案是正确的,因为它是最详细和有用的。
解决方案/ strong>。 Aspnet_isapi.DLL,它处理执行ASP.NET应用程序,不了解经典的ASP,并将尝试将经典的VBScript代码解析为.NET VBScript。
这是可行的唯一方法是如果您的.ASP页面中没有(而且我的意思是绝对无)经典ASP代码。 / p>
如果是这种情况,您可以将.ASP扩展名映射到IIS管理器中的aspnet_isapi。
同样,如果您的.asp页面中有任何代码,这将导致每个.asp page。
另一个选择是使用重写引擎(我们使用 ISAPI Rewrite )将传入请求的文件扩展名从.asp更改为.aspx。
为什么不想在服务器上安装经典的ASP?它与ASP.NET并行工作很好。
编辑
实际上称为处理程序映射。见上图。
I have an older classic ASP website that I am migrating over to IIS7.5. I don't feel like installing classic ASP on the server, and so I just want the .asp files to be treated as if they were .aspx files.
How do I go about doing this in IIS7.5?
EDIT: To clarify, I am NOT asking how to get classic ASP code to work under .Net. I am just asking how to map the .ASP file extension to be handled by the runtime. I will upgrade the code in the .asp files to .
EDIT:
I gave up and ended up installing classic ASP, as I couldn't get the mapping to work (received a combination of 404.17 and 404.3 errors). I marked David Lively's answer as correct as it was the most detailed and helpful.
解决方案That's not going to work. Aspnet_isapi.DLL, which handles executing ASP.NET applications, doesn't understand classic ASP, and will try to parse the classic VBScript code as .NET VBScript.
The only way this is feasible is if you have no (and I mean ABSOLUTELY NONE) classic ASP code in your .ASP pages.
If that is the case, you can map the .ASP extension to aspnet_isapi in IIS manager.
Again, if you have any code in your .asp pages, this will cause a glorious, technicolor failure for every .ASP page.
Another option is to use a rewrite engine (we use ISAPI Rewrite) to change the file extension of incoming requests from from .asp to .aspx.
Why don't you want to install classic ASP on the server? It works just fine in parallel with ASP.NET.
edit
It's actually called "handler mappings." See image above.
更多推荐
如何使用.Net处理程序处理.asp扩展?
发布评论