繁体   English   中英

在web.config中重定向

[英]Redirect in web.config

有人可以让我知道为什么以下内容无法正确重写吗?

<rule name="Redirect account listing with levelId" stopProcessing="true">
<match url="^account/([^/]+)/([^/]+)/([^/]+)[?levelId=]$" />
<conditions>
  <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
  <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Redirect" url="account/{R:1}/{R:2}/{R:3}" appendQueryString="false" />

我正在尝试重定向,以便删除“?levelId =。

我想到了...

<rule name="Redirect account listing with levelId b" stopProcessing="true">
<match url="^account/([^/]+)/([^/]+)/([^/]+)" />
<conditions>
  <add input="{REQUEST_METHOD}" pattern="^POST$" negate="true" />
  <add input="{QUERY_STRING}" pattern="^levelID=([^=&amp;]+)$" />
</conditions>
<action type="Redirect" url="account/{R:1}/{R:2}/{R:3}" appendQueryString="false" />

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM