我有一个以下字符串变量:
string example = "<div class=\"content\">" + Environment.NewLine + "[some content here]" + "/div";
Run Code Online (Sandbox Code Playgroud)
如何在页面正文中将其呈现为html标记?
观看了关于同一问题的几个主题。没有一个对我有用。问题是:我有从 create-react-app 设计的 ReactJS + Redux 应用程序。实际上它可以工作,但是当应用程序冲浪以不同于 root 的 URL 开始时,会抛出 404。安装iisnode并尝试了网络中推荐的不同重写规则,但没有任何效果。最后是这个:
<rule name="Redirect HTTP to HTTPS">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent"/>
</rule> -->
<rule name="Redirect non-existent paths to root">
<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="^/initialLogin/*" ignoreCase="true" negate="true" />
</conditions>
<action type="Redirect" url="/" appendQueryString="false" />
</rule>
</rules>
</rewrite>
Run Code Online (Sandbox Code Playgroud)
我唯一需要的是通过根 url 发送所有传入请求,并将其余地址传递给它,以便 SPA 可以正常工作。托管:AzureVM IIS:v10
编辑:另一个奇怪的事情是它iisnode可以处理 …