部署在 azure web 应用程序上时找不到 React 应用程序上的字体
我从早上起就一直在尝试在天蓝色上部署我的简单反应应用程序,除了字体之外,所有内容都加载得很完美! 控制台中得到的内容
Failed to load resource: the server responded with a status of 404 (Not Found)
CircularStd-Bold.5c4514a8399ec0064b9b.otf
这是我在访问字体链接时在
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
我得到一个包含以下错误的页面我阅读了数千篇文章我确实将我的 web.config 文件添加到公共文件夹中,代码如下:
<?xml version="1.0"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="React Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
</conditions>
<action type="Rewrite" url="/" />
</rule>
</rules>
</rewrite>
<staticContent>
<mimeMap fileExtension=".otf" mimeType="font/otf" />
</staticContent>
</system.webServer>
</configuration>
我在做什么请问错了吗?
I've been trying since the morning to deploy my simple react app on azure, everything is loaded perfectly except the FONTS !
here's what i get in the console
Failed to load resource: the server responded with a status of 404 (Not Found)
CircularStd-Bold.5c4514a8399ec0064b9b.otf
when i access the link of the font i get a page with the following error
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
i read thousands of articles i did add my web.config file to the public folder, with the following code :
<?xml version="1.0"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="React Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
</conditions>
<action type="Rewrite" url="/" />
</rule>
</rules>
</rewrite>
<staticContent>
<mimeMap fileExtension=".otf" mimeType="font/otf" />
</staticContent>
</system.webServer>
</configuration>
WHAT AM I DOING WRONG PLEASE?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是添加 webconfig 文件和静态文件中存在的字体后的 wwwroot 文件夹
Here's an the wwwroot folder after adding the webconfig file and the fonts present in the static file