IIS URL重写在复杂URL上不起作用
我有两个URL重定向规则:IIS URL重写在复杂URL上不起作用,url,iis,sharepoint,url-rewriting,Url,Iis,Sharepoint,Url Rewriting,我有两个URL重定向规则: <rewrite> <rules> <clear /> <rule name="al - helyek/al (kieg)" enabled="true" stopProcessing="true"> <match url="^test1/al/(.*)RootFolder=%2Ft
<rewrite>
<rules>
<clear />
<rule name="al - helyek/al (kieg)" enabled="true" stopProcessing="true">
<match url="^test1/al/(.*)RootFolder=%2Ftest1(.*)" />
<action type="Redirect" url="helyek/al/{R:1}RootFolder=%2Fhelyek{R:2}" />
</rule>
<rule name="al - helyek/al" enabled="true" stopProcessing="true">
<match url="^test1/al/(.*)" />
<action type="Redirect" url="helyek/al/{R:1}" />
</rule>
</rules>
</rewrite>
但是第一个不起作用,只有第二个
测试URL:http://test:29001/test1/al/Megosztott%20dokumentumok/Forms/AllItems.aspx?RootFolder=%2Ftest1%2Fal%2FMegosztott%20dokumentumok%2FTeszt&FolderCTID=0x01200077BA4D1F1CDCF3498096871FD748FB37&View=%7B70C95A37%2D4FE1%2D4A60%2DA100%2D61E529A1DB56%7D
这是一个SharePoint网站集
可能是什么问题?根据您的描述,RootFolder似乎是查询字符串中的内容。如果需要匹配查询字符串中的内容,则需要使用服务器变量{querystring}进行匹配 这有一个类似的问题:
我找到了正确的重定向:
<rule name="WEBHELY - helyek/WEBHELY (RootFolder)" stopProcessing="true">
<match url="^WEBHELY/(.*)" />
<conditions>
<add input="{QUERY_STRING}" pattern="(.*)?RootFolder=%2FWEBHELY(.*)" />
</conditions>
<action type="Redirect" url="helyek/WEBHELY/{R:1}?RootFolder=%2Fhelyek%2FWEBHELY{C:2}" appendQueryString="false" />
</rule>
<rule name="WEBHELY - helyek/WEBHELY" stopProcessing="true">
<match url="^WEBHELY/(.*)" />
<action type="Redirect" url="helyek/WEBHELY/{R:1}" />
</rule>
查询字符串不由
match
标记处理。使用FRT了解更多信息,