gpt4 book ai didi

iis - WebMatrix 将 .html 文件解析为 .asp

转载 作者:行者123 更新时间:2023-12-04 13:51:51 30 4
gpt4 key购买 nike

我有一个扩展名为 .html 的文件,其中包含:

<!--#include virtual="filename"-->

指令,我正在使用 Microsoft WebMatrix。当我从 WebMatrix 运行网页时,不处理该指令,而是该指令显示在 HTML 中。如何配置 WebMatrix 以将这些页面视为 .asp 文件?

最佳答案

您需要配置 Web 服务器以将 .html 文件映射到 asp.dll。如果您想使用 IIS Express 在本地执行此操作,您可以在 <handlers> 部分下的 applicationhost.config 文件中添加一个新条目,如下所示:

    <add name="ASPClassicHtml" path="*.html" verb="GET,HEAD,POST" 
modules="IsapiModule" scriptProcessor="%IIS_BIN%\asp.dll"
resourceType="File" />

这基本上是 ASPClassic 现有条目的副本,但指向 html 文件。您通常可以在 My Documents > IISExpress > config 中找到 applicationhost.config。

关于iis - WebMatrix 将 .html 文件解析为 .asp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5787319/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com