0

A similar question has been asked before but solution to that didn't help me. I created a file "dave.php" in application/classes/Controller/ folder and I renamed the controller as well. Here's the code in dave.php file:

<?php defined('SYSPATH') OR die('No Direct Script Access');

Class Controller_Dave extends Controller
{
public function action_index()
{
    echo 'hello, world!';
}
}

kohana/index.php/dave - but I am still geting that error. Any ideas why?

4

2 回答 2

5

好像你用的是Kohana 3.3,所以文件名应该Dave.php不是dave.php

于 2013-07-04T14:39:19.907 回答
0

那是我的 htaccess

重写引擎开启

RewriteBase /

RewriteRule ^(application|modules|system) - [F,L]

RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule .* index.php/$0 [PT,L]

检查,apache mod_rewrite 是否启用并在 phpinfo() 加载;就我而言,我刚刚在 apache 上启用了 mod_rewrite。

 sudo a2enmod rewrite 

然后重新启动

sudo systemctl restart apache2

检查 .htaccess 规则。

请注意,控制器名称区分大小写。

于 2018-01-06T11:42:57.473 回答