0

I have slim framework with .htaccess and front end app which calls api through http protocol.

On Apache call is made to /api/v1/login - which returns JSON response.

On IIS when i do the same call, it returns html contents of /index.php

apache .htaccess is:

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^(.*)$ %{ENV:BASE}index.php [QSA,L]

IIS web.config ( from Slim framework website ):

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="slim" patternSyntax="Wildcard">
                    <match url="*" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

What should i do to get proper JSON response on IIS, instead of /index.php contents?

edit

in IIS Manager | Connection | Handler Mappings i have

PHP53_via FastCGI as name for *.php , enabled , file or folder , FastCgiModule

PHP55_via FastCGI as name for *.php , enabled , file or folder , FastCgiModule

If my call type is to /api/v1/login - how can i configure it?

==edit

following this i received error 500 from api, which means that maybe url rewrite works.

Community
  • 1
  • 1
changtung
  • 1,614
  • 15
  • 19

0 Answers0