2017-11-18 57 views
0

我“米在Azure上运行我的PHP笨的应用程序。Azure上的codeigniter应用程序的css文件中的字体路径显示404?

在我的CSS,我已经设置字体路径波纹管

@font-face { 
    font-family: Sample1-Light; 
    src: url('../fonts/Sample1/Sample1-Light.otf'); 
} 

上面的代码工作以及我的本地主机上,但一旦我把它放在Azure的,它让我的404错误

http://samplewebsite1.azurewebsites.net/Helloworld/assets/fonts/Sample1/Sample1-Light.otf 404 (Not Found) 

我的“字体”文件夹中的资产文件夹(资产/字体“)和CSS文件中,在资产的文件夹(资产/ CSS”的css文件夹中)。

+0

那么,什么是正确的网址,将使它发挥作用? – TimBrownlaw

回答

1

你需要创建一个web.config文件,如果不是在你的应用程序的根目录中,并把下列它:

<?xml version="1.0" encoding="UTF-8" ?> 
<configuration> 
    <system.webServer> 
     <staticContent> 
      <remove fileExtension=".otf" /> 
      <mimeMap fileExtension=".otf" mimeType="application/font-sfnt" /> 
     </staticContent> 
    </system.webServer> 
</configuration> 
+0

工作!@Aaron陈 –

相关问题