IIS7本地不支持。htaccess文件。虽然有插件可以添加这个支持,您也可以htaccess规则导入到IIS使用CakePHP的原生重写。要做到这一点,遵循这些步骤:
使用微软Web平台安装程序2.0安装URL重写模块或直接下载它(32位/ 64位)。
创建一个名为web的新文件。配置在CakePHP根文件夹。
使用记事本或任何对它们进行编辑,将下面的代码复制到你的新网站。配置文件
使用微软Web平台安装程序2.0安装URL重写模块或直接下载它(32位/ 64位)。
创建一个名为web的新文件。配置在CakePHP根文件夹。
使用记事本或任何对它们进行编辑,将下面的代码复制到你的新网站。配置文件
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Rewrite requests to test.php"
stopProcessing="true">
<match url="^test.php(.*)$" ignoreCase="false" />
<action type="Rewrite" url="app/webroot/test.php{R:1}" />
</rule>
<rule name="Exclude direct access to app/webroot/*"
stopProcessing="true">
<match url="^app/webroot/(.*)$" ignor