laravel iis web.config仅适用于特定路由

时间:2018-01-11 16:17:35

标签: iis

我在iis服务器上运行了laravel。有一个默认的重写规则,将所有未知的URL重定向到index.php

我想将此规则仅应用于路径以/api开头的网址 另外还有确切的路径/login

所以

mydomain1.com/assets/logo.png应指向该文件,如果该文件不存在则失败

mydomain1.com/api/users
mydomain2.com/api/posts/tags
mydomain1.com/login

应该全部重定向到index.php

这是没有条件的规则:

        <rule name="Laravel5" stopProcessing="true" enabled="true">
            <match url="^" ignoreCase="false"/>
            <conditions logicalGrouping="MatchAll">
                <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
                <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
            </conditions>
            <action type="Rewrite" url="index.php" appendQueryString="true"/>
        </rule>

0 个答案:

没有答案