我正在尝试将旧网址重定向到某些现有用户的新网址。 这是我的源网址:
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上的一些可用帖子,但无法正确解释它们。有关此问题的任何帮助将不胜感激。
由于 的Manoj
答案 0 :(得分:1)
此规则适用于您:
<rule name="Old Url Rewrite" stopProcessing="true">
<match url="^candidate/details/(.*)" />
<action type="Redirect" url="/jobs/details/{R:1}" />
</rule>