簡體   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