Url 重写旧网址无效

Url Re-write for old urls is not working

我正在尝试将我的旧 url 重定向到某些现有用户的一些新 url。 这是我的来源 url:

www.example.com/candidate/details/test-name/123

http://www.example.com/jobs/details/test-name/123

我尝试在 web.config 文件中重写 url 如下:

  <rule name="Old Url Rewrite" stopProcessing="true">
      <match url="^/candidate/details/.*" />
      <conditions logicalGrouping="MatchAll">
           <add input="{REQUEST_URI}" ignoreCase="true" negate="true" />
      </conditions>
      <action type="Rewrite" url="{REQUEST_URI}/jobs/details/{R:1}" />
    </rule>
  </rules>

我不太了解 url-rewrit 功能。我关注了 SOF 上的一些可用帖子,但无法正确解释它们。任何有关此问题的帮助将不胜感激。

谢谢 马诺杰

这条规则适合你:

<rule name="Old Url Rewrite" stopProcessing="true">
    <match url="^candidate/details/(.*)" />
    <action type="Redirect" url="/jobs/details/{R:1}" />
</rule>