IIS重写为index.php导致URL错误

时间:2018-07-11 10:08:38

标签: php laravel iis url-rewriting

我正在设置一个IIS服务器来运行Laravel为我们的应用程序制作的后端。一些旧路线以/index.php结尾,这对我稍后将要解释的内容很重要。

重写配置如下:

<rewrite>
    <rules>
       <clear />
       <rule name="Rewrite to index.php" stopProcessing="true">
       <match url="^" ignoreCase="true" />
       <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
           <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
           <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
       </conditions>
       <action type="Rewrite" url="current/public/index.php" />
        </rule>
    </rules>
</rewrite>

这是一个简单的重写,因此每条路由都会攻击public/index.php中的Laravel入口点。

所有路由都可以正常工作,除非它们以index.php结尾。有问题的路线是:

mydomain.net/api/ecg/webservices/obtenerTuUsuario/index.php

我们的框架收到的请求路由是:

mydomain.net/current/public/index.phpnerTuUsuario/index.php

因此,看来IIS正在将重写叠加在原始路由上。我尝试了一切,但没有运气。我想这与其他IIS配置有关,但我不知道。

预先感谢

0 个答案:

没有答案