我知道这个主题已经有其他几个帖子,但我已经尝试了他们所说的一切,但我似乎无法让它发挥作用。
我在http://localhost/kohana中安装了 php kohana 框架,它正在工作。问题是我无法从我的 URL 中删除 /index.php/。
我尝试将 .htaccess 文件从安装导入 IIS URL Rewrite 模块,但没有运气。
我的引导程序如下
Kohana::init(array(
'base_url' => '/kohana',
'index_file' => ''
));
我放在 /kohana 目录中的 web.config 看起来像这样
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(?:application|modules|system)\b.*" ignoreCase="false" />
<action type="Rewrite" url="index.php/{R:0}" />
</rule>
<rule name="Imported Rule 2">
<match url=".*" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
我也试过这个页面上的重写规则
似乎没有任何效果。如果我去http://localhost/kohana/index.php/welcome它工作。如果我访问http://localhost/kohana/welcome,我会从 IIS 收到 404 错误(在 kohana 中不是 404)。
我觉得我的头撞墙了,有什么想法吗?