IIS 7 (web.config)

ademirademir Entry Level
edited July 2016 in Tutorial
Se alguém precisar rodar o sistema no IIS 7.0, segue um exemplo de como deve ser o web.config para contornar o problema das urls amigáveis:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<clear />
<rule name="regra_1_public_api" stopProcessing="true">
<match url="^public(/|\\)api(.*)" ignoreCase="true" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="public/api/index.php" appendQueryString="true" />
</rule>
<rule name="regra_2_public" stopProcessing="true">
<match url="^public(.*)" ignoreCase="true" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="public/index.php" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Tagged:
Sign In or Register to comment.