2013-04-27 69 views
0

我有bootstrap.php中:PHP Kohana的路由不行

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错误页面,Apache默认404错误页面。哪里不对?

回答

1

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