Kohana_HTTP_Exception [ 404 ]: The requested URL Dave was not found on this server

StackOverflow https://stackoverflow.com/questions/17472956

  •  02-06-2022
  •  | 
  •  

Pergunta

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?

Foi útil?

Solução

It seems that you use Kohana 3.3, so the file name should be Dave.php not dave.php

Outras dicas

That is my htaccess

RewriteEngine On

RewriteBase /

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

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

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

Check, is apache mod_rewrite enable and loaded at phpinfo(); In My case I've just enable mod_rewrite at apache.

 sudo a2enmod rewrite 

and than restart

sudo systemctl restart apache2

Check .htaccess rules.

And note, that Controllers names are case sensitivity.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top