我有一个托管在 Azure blob 存储中的单页 React 应用程序,但在深度链接到页面时收到请求的内容不存在。错误:
我已在存储帐户中启用静态网站选项:
这些文件都位于 $web 容器中:
这包括以下web.config,其中包含一个重写规则,该规则应该让index.html处理所有路由:
<?xml version="1.0" encoding="utf-8"?>
<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" />
</conditions>
<action type="Rewrite" url="/" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
谁能看出我哪里出了问题吗?
最佳答案
关于asp.net - web.config 重写规则在 Blob 存储中的 Azure 静态网站中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55598531/