开发者

Create a rule with Service.Transfer() Behaviour IIS Rewriting Module

开发者 https://www.devze.com 2023-04-01 23:46 出处:网络
Is it possible to create a rule that has a behaviour similar to the Serv开发者_运维百科ice.Transfer from ASP ?Using IIS7 Rewriting Module you can use a Rewrite Action.

Is it possible to create a rule that has a behaviour similar to the Serv开发者_运维百科ice.Transfer from ASP ?


Using IIS7 Rewriting Module you can use a Rewrite Action.

This keeps the original URL but rewrites the path which your application will see and process in a similar way to Server.Transfer.

<rewrite>
  <rules>
    <rule name="Rewrite to article.aspx">
      <match url="^article/([0-9]+)/([_0-9a-z-]+)" />
      <action type="Rewrite" url="article.aspx?id={R:1}&amp;title={R:2}" />
    </rule>
  </rules>
</rewrite>

Have a look at the rules overview.

This essentially is the same as Context.RewritePath.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号