Laravel 主路线有效,但其他路线在托管后无效
Laravel home route works but the rest are not working after hosting
我在在线服务器(子域)上托管了我的 laravel 应用程序,只有主路由 works.What 可能是问题所在?
作品:
http//:test.mydomin.com
不工作
http//:test.mydomin.com/test
我发现我使用的主机不是 Apache 而是 IIS,web.config 上的以下配置解决了我的问题。
<?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="IsDirectory" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration
我在在线服务器(子域)上托管了我的 laravel 应用程序,只有主路由 works.What 可能是问题所在?
作品:
http//:test.mydomin.com
不工作
http//:test.mydomin.com/test
我发现我使用的主机不是 Apache 而是 IIS,web.config 上的以下配置解决了我的问题。
<?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="IsDirectory" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration