![](/img/trans.png)
[英]Replacing backslashes, forward slashes and double forward slashes with double backslashes
[英]How to prevent IIS not to change backslashes with forward slashes
我正在使用WebAPI2,我有一條路線“Products / {Id} / details”。 當Id包含\\時,IIS將其更改為/ 。 例如, pr \\ p更改為pr / p並且它“破壞”uri。 我想知道如何防止將**更改為** / ,還是有其他解決方法?
在此先感謝您的幫助。
這看起來很有用:
<rule name="KeepBackslashes" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="http://HOST:PORT/{UrlDecode:{C:1}}" logRewrittenUrl="true" />
<conditions>
<add input="{UNENCODED_URL}" pattern="/(.*?)($|\?)" />
</conditions>
</rule>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.