Wdrażam witrynę na platformie Azure i próbuję przepisać reguły przepisywania witryny.Dlaczego otrzymuję 500, gdy dodaję regułę przepisywania do mojego Web.config na Azure?
Mam następujący kod, a to działa:
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Sendy all" stopProcessing="true">
<match url="^(.+?)$" 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="index.php" appendQueryString="true" />
</rule>
<rule name="Sendy all" stopProcessing="true">
<match url="^api/(.+?)$" ignoreCase="true" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
ale kiedy dodać następujący kod wewnątrz znacznika reguł pojawia się komunikat o błędzie The page cannot be displayed because an internal server error has occurred
. Czemu?
<rule name="Sendy all" stopProcessing="true">
<match url="^api/(.+?)$" ignoreCase="true" />
<conditions logicalGrouping="MatchAll" trackAllCaptures="false">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" appendQueryString="true" />
</rule>
Myślę, że powinieneś sformatować swoje pytanie. Nie mogę zobaczyć, jaką regułę dodajesz. Trzeci jest taki sam, jak drugi, o którym mówisz. Wszystkie trzy reguły (dwa duplikaty) mają te same nazwy. Proponuję opublikować jedną wersję, która działa, a drugą, która nie działa. –