嗨,我的 kohana 代码有问题,它给了我同样的错误,我认为 htaccess 或引导程序有问题
它安装在我的根目录中,而不是作为子文件夹。
Kohana_HTTP_Exception [ 404 ]: The requested URL / was not found on this server.
SYSPATH/classes/Kohana/Request/Client/Internal.php [ 79 ]
74 if ( ! class_exists($prefix.$controller))
75 {
76 throw HTTP_Exception::factory(404,
77 'The requested URL :uri was not found on this server.',
78 array(':uri' => $request->uri())
79 )->request($request);
80 }
81
82 // Load the controller using reflection
83 $class = new ReflectionClass($prefix.$controller);
84
SYSPATH/classes/Kohana/Request/Client.php [ 114 ] » Kohana_Request_Client_Internal->execute_request(arguments)
SYSPATH/classes/Kohana/Request.php [ 990 ] » Kohana_Request_Client->execute(arguments)
DOCROOT/index.php [ 109 ] » Kohana_Request->execute()
这是我的 htaccess 代码
# Turn on URL rewriting
RewriteEngine On
# Installation directory
RewriteBase /
# Protect hidden files from being viewed
<Files .*>
Order Deny,Allow
Deny From All
</Files>
# Protect application and system files from being viewed
RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L]
# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT]
#-SetEnv KOHANA_ENV "production"
在引导程序中,我将 site_url 设置为“/”