首页 > 解决方案 > 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

标签: iis-7iis-7.5

解决方案


检查 Mime 类型。生产服务器上的字体可能不会添加 MIME 类型。


推荐阅读