根据IP掩码在两个文件夹之间重定向IIS7中的用户

根据IP掩码在两个文件夹之间重定向IIS7中的用户,iis,server,iis-7,Iis,Server,Iis 7,假设我有默认网站和文件夹 大致上,这棵树看起来是这样的: |- Server |- Default Web Site |- folder1 |- folder2 我想根据用户的IP掩码将其重定向到我网站中的不同文件夹 例如,如果用户的IP具有以下模式: - 10.10.10.* IIS has to redirect to "folder1" - 11.11.11.* IIS has to redirect to "folder2" 这可能吗?如果是这

假设我有
默认网站和文件夹

大致上,这棵树看起来是这样的:

|- Server
    |- Default Web Site
        |- folder1
        |- folder2
我想根据用户的IP掩码将其重定向到我网站中的不同文件夹

例如,如果用户的IP具有以下模式:

- 10.10.10.* IIS has to redirect to "folder1"
- 11.11.11.* IIS has to redirect to "folder2"
这可能吗?如果是这样,那怎么办?


 <rule name="RedirectBySourceIP1" stopProcessing="true">
                <match url="(.*)" />
                <conditions>
                    <add input="{REMOTE_ADDR}" pattern="10.10.10.(.*)" />
                    <add input="{URL}" pattern="folder1(.*)" negate="true" />
                </conditions>
                <action type="Redirect" url="/folder1" />
            </rule>
 <rule name="RedirectBySourceIP2" stopProcessing="true">
                <match url="(.*)" />
                <conditions>
                    <add input="{REMOTE_ADDR}" pattern="11.11.11.(.*)" />
                    <add input="{URL}" pattern="folder2(.*)" negate="true" />
                </conditions>
                <action type="Redirect" url="/folder2" />
            </rule>