如何在angular中执行301永久重定向
我使用angular(版本10)Universal为我的web应用程序提供服务,而且我的web服务器是IIS。 如何从此url:到此url:执行301永久重定向。如何在angular中执行301永久重定向,angular,iis,Angular,Iis,我使用angular(版本10)Universal为我的web应用程序提供服务,而且我的web服务器是IIS。 如何从此url:到此url:执行301永久重定向。 我已经尝试过了,但不起作用请使用如下web.config文件: <configuration> <system.webServer> <rewrite> <rules>
我已经尝试过了,但不起作用请使用如下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>