PHP Kohana路由不工作


PHP Kohana routing not work

我有bootstrap.php:

Kohana::init(array(
    'base_url'   => '/wypoczynek/',
    'index_file' => false,
));
Route::set('default', '(<controller>(/<action>(/<id>)))')
    ->defaults(array(
        'controller' => 'home',
        'action'     => 'index',
    ));
Route::set('dodaj-obiekt', 'dodaj-obiekt(/<action>(/<id>))')
    ->defaults(array(
        'controller' => 'object',
        'action'     => 'addObject',
    ));

. htaccess:

RewriteEngine On
RewriteBase /wypoczynek/
<Files .*>
    Order Deny,Allow
    Deny From All
</Files>
RewriteRule ^(?:application|modules|system)'b.* index.php/$0 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT]

链接:http://domain.pl/wypoczynek工作良好,但http://domain.pl/wypoczynek/dodaj-obiekt不工作。我看到404错误页面,默认的404错误页面由Apache。怎么了?

更通用的路由应该放在最后。它们按照声明中的顺序匹配,所以把你的默认路由放在最后。