我正在使用angular(version 10)Universal服务于我的Web应用程序,并且我的Web服务器是IIS。 如何执行从该URL:https://myapp.com/a到此URL:https://myapp.com/b的301永久重定向。 我已经尝试过this solution,但无法正常工作
答案 0 :(得分:1)
使用这样的web.config文件:
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Angular Routes" stopProcessing="true">
<match url=".*NEWPDS.*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="./index.html" />
</rule>
<rule name="URL1" stopProcessing="true">
<match url="^onetoberedirected.html" ignoreCase="true" />
<action type="Redirect" url="desiredPage" redirectType="Permanent" />
</rules>
<outboundRules>
</outboundRules>
</rewrite>
</system.webServer>
</configuration>