Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
URL重写问题_Url_Url Rewriting_Iis 8 - Fatal编程技术网

URL重写问题

URL重写问题,url,url-rewriting,iis-8,Url,Url Rewriting,Iis 8,我正在尝试通过URL重写2.1为IIS 8.5中的虚拟应用程序创建别名 这条规则根本不起作用。我得到404错误 Here is my rewrite section in web.config: <rewrite> <rules> <rule name="MBAM Helpdesk" stopProcessing="true"> <match

我正在尝试通过URL重写2.1为IIS 8.5中的虚拟应用程序创建别名 这条规则根本不起作用。我得到404错误

Here is my rewrite section in web.config:
        <rewrite>
            <rules>
                <rule name="MBAM Helpdesk" stopProcessing="true">
                    <match url="https://my.site.com/helpdesk" />
                    <action type="Rewrite" url="https://my.site.com/Microsoft%20BitLocker%20Administration%20and%20Monitoring" />
                </rule>
            </rules>
        </rewrite>
这是我在web.config中的重写部分:

返回404错误

根据您的描述,首先如果您想重定向准确的url,您应该在规则中添加patternSyntax=“ExactMatch”,然后url rewrite中的match标记只能得到url的路径,而不能得到整个url。所以我建议你可以写如下:

Here is my rewrite section in web.config:
        <rewrite>
            <rules>
                <rule name="MBAM Helpdesk" stopProcessing="true">
                    <match url="https://my.site.com/helpdesk" />
                    <action type="Rewrite" url="https://my.site.com/Microsoft%20BitLocker%20Administration%20and%20Monitoring" />
                </rule>
            </rules>
        </rewrite>
<rule name="rule1" patternSyntax="ExactMatch">
                    <match url="helpdesk" />
                    <action type="Rewrite" url="https://my.site.com/Microsoft%20BitLocker%20Administration%20and%20Monitoring" />
                </rule>

根据您的描述,首先,如果您想重定向准确的url,您应该在规则中添加patternSyntax=“ExactMatch”,然后url rewrite中的match标记只能得到url的路径,而不能得到整个url。所以我建议你可以写如下:

<rule name="rule1" patternSyntax="ExactMatch">
                    <match url="helpdesk" />
                    <action type="Rewrite" url="https://my.site.com/Microsoft%20BitLocker%20Administration%20and%20Monitoring" />
                </rule>

错误1错误1