iis-7 - IIS express 和 IIS7 路径
问题描述
我专家,我需要更新在 IIS7 中运行的 Web 程序上的一些 dll。我在我的 PC 上使用 Visual Studio 和 IIS express 准备了所有工作,所有更改都运行良好。所以我做了一个本地文件系统部署并将内容复制到运行 IIS7 的生产服务器。某些字体、字形无法正确显示。在网络选项卡中,我可以看到所有未加载的文件都有 301 永久重定向,然后找不到 404。我仔细检查了文件存在的服务器目录。
我唯一能看到的是路径不一样。例如,在 IIS Express 上: http://localhost:49193/Content/kendo/fonts/glyphs/WebComponentsIcons.ttf?gedxeo 然后在生产站点上 http://ProductionSite.com/Content/fonts/glyphs/WebComponentsIcons.ttf ?gedxeo
文件的源代码在 css 中,如下所示: src:url(fonts/glyphs/WebComponentsIcons.eot?gedxeo)
任何想法?
UPDATE1 Mime 定义:
<dynamicTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<!-- Compress XML files -->
<add mimeType="application/xml" enabled="true" />
<!-- Compress JavaScript files -->
<add mimeType="application/javascript" enabled="true" />
<!-- Compress JSON files -->
<add mimeType="application/json" enabled="true" />
<!-- Compress SVG files -->
<add mimeType="image/svg+xml" enabled="true" />
<!-- Compress RSS feeds -->
<add mimeType="application/rss+xml" enabled="true" />
<!-- Compress Atom feeds -->
<add mimeType="application/atom+xml" enabled="true" />
<add mimeType="*/*" enabled="false" />
</dynamicTypes>
<staticTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="application/atom+xml" enabled="true" />
<add mimeType="application/xaml+xml" enabled="true" />
<!-- Compress ICO icon files (Note that most .ico files are uncompressed but there are some that can contain PNG compressed images. If you are doing this, remove this line). -->
<add mimeType="image/x-icon" enabled="true" />
<!-- Compress XML files -->
<add mimeType="application/xml" enabled="true" />
<add mimeType="application/xml; charset=UTF-8" enabled="true" />
<!-- Compress JavaScript files -->
<add mimeType="application/javascript" enabled="true" />
<!-- Compress JSON files -->
<add mimeType="application/json" enabled="true" />
<!-- Compress SVG files -->
<add mimeType="image/svg+xml" enabled="true" />
<!-- Compress EOT font files -->
<add mimeType="application/vnd.ms-fontobject" enabled="true" />
<!-- Compress TTF font files - application/font-ttf will probably be the new correct MIME type. IIS still uses application/x-font-ttf. -->
<!--<add mimeType="application/font-ttf" enabled="true" />-->
<add mimeType="application/x-font-ttf" enabled="true" />
<!-- Compress OTF font files - application/font-opentype will probably be the new correct MIME type. IIS still uses font/otf. -->
<!--<add mimeType="application/font-opentype" enabled="true" />-->
<add mimeType="font/otf" enabled="true" />
<!-- Compress RSS feeds -->
<add mimeType="application/rss+xml" enabled="true" />
<add mimeType="application/rss+xml; charset=UTF-8" enabled="true" />
<add mimeType="*/*" enabled="false" />
</staticTypes>
C
解决方案
检查 Mime 类型。生产服务器上的字体可能不会添加 MIME 类型。
推荐阅读
- sql - 如何在oracle sql查询中提取括号之间的文本
- c++ - 如果不为每个分配 1,“int x,y,z = 1”在做什么?
- r - 如何使用应用函数或循环对 R 中的每一列进行方差分析?
- azure-devops-rest-api - 在 C# 中反序列化 Azure Devops API 中的变量
- python-3.x - 试图从 YouTube 数据 API 上的频道及其评论中检索 videoid
- python - 堆叠 Ensenble 卷积神经网络
- wordpress - wordpress 多站点域映射重定向
- stata - 有没有办法在 Stata 中初始化 3D 矩阵?
- python - 为什么我不能用 django 运行“python manage.py startup APP_NAME”?
- python - 如何从函数中的 matpltlib 事件中选择点?