html - 具有特殊文件名的 IIS?
问题描述
我用“wayback_machine_downloader”下载了一些网站。有些文件的名称如super.html!q=4343
. 但 IIS 并未将其检测为 HTML 文件,Windows 检测到文件扩展名为.html!q=4343
.
我想要这样的东西:当人们去的时候,http://www.example.com/super.html!q=4343
我想把这个文件显示为一个普通的 HTML。这在代码中只是一个纯 HTML。
我知道要更改扩展名,但其他 HTML 文件链接到这个/super.html!q=4343
。
还有一些具有不同编号和内容的文件。(喜欢/super.html!q=6556
或/super.html!d=5545
)
我不擅长写英语问题,但这是我最好的。对此感到抱歉。
有没有办法解决?谢谢!
解决方案
通常,您需要在网站的 web.config 中添加 mime 地图。例如,要使 URLhttp://www.example.com/super.html!q=4343
起作用,您可以执行以下操作:
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".html!q=4343" mimeType="text/html" />
</staticContent>
</system.webServer>
</configuration>
以上仅适用于特定扩展。要使用所有扩展程序,请使用下面的代码段。这将适用于所有扩展。
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension="*" mimeType="text/html" />
</staticContent>
</system.webServer>
</configuration>
推荐阅读
- linux - 解析 systemd 别名(服务名称)
- c# - 当一个对象等于测试方法中的另一个对象时?
- pgadmin-4 - 将 Pgadmin4 从 3.4 更新到 4.2
- cmake - 如何检测 C++11-... 对带有 CMake 的编译器的支持并做出反应而不会生成失败
- java - 无法在类内部和外部方法中使用 webdriver 类的驱动程序对象,但能够在同一类的方法中访问它谁能解释一下?
- ios - 日期比较失败
- spring - Mongodb 仅根据日期和月份检索记录
- ruby-on-rails - 添加具有默认空值的列
- ios - 无法加载 iOS 应用程序接口来测试我的应用程序
- ios - 从导航栏按钮项目中隐藏或删除特定项目,Swift 4