我在 IIS 上遇到了 Cakephp 3.2 版的问题。但是,Cakephp 2.2 版在相同的设置环境中运行良好。不知道为什么?
这是我的web.config
文件。
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Exclude direct access to webroot/*"
stopProcessing="true">
<match url="^webroot/(.*)$" ignoreCase="false" />
<action type="None" />
</rule>
<rule name="Rewrite routed access to assets(img, css, files, js, favicon)"
stopProcessing="true">
<match url="^(img|css|files|js|favicon.ico)(.*)$" />
<action type="Rewrite" url="webroot/{R:1}{R:2}"
appendQueryString="false" />
</rule>
<rule name="Rewrite requested file/folder to index.php"
stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<action type="Rewrite" url="index.php"
appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
以上内容抄自Cakephp官方论坛。
无论我们在 URL 中输入什么,我都会得到以下响应
注意:
我尝试了 SO 中的所有相关链接,并在尝试了所有提供的解决方案后发布了此链接,但没有一个有效。
更多信息 :
IIS 版本 - 10 Cakephp - 3.2
我再说一遍,Cakephp 2.2 运行良好。