IIS Symfony 4, 404 错误
IIS Symfony 4, 404 Error
我正在尝试在我的环境中制作 symfony 4 演示应用程序。
我正在使用带有 CGI 和重写模块的 IIS。我无法访问演示的主页,我认为我的 IIS 配置没有配置好。 symfony 4 和 IIS 有标准 web.config 吗?我什么都没找到。
我终于成功了。我将 htaccess 的重写规则转换为 IIS xml。
它看起来像下面。希望对其他人有帮助。
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
我正在尝试在我的环境中制作 symfony 4 演示应用程序。 我正在使用带有 CGI 和重写模块的 IIS。我无法访问演示的主页,我认为我的 IIS 配置没有配置好。 symfony 4 和 IIS 有标准 web.config 吗?我什么都没找到。
我终于成功了。我将 htaccess 的重写规则转换为 IIS xml。 它看起来像下面。希望对其他人有帮助。
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>