Kohana 3.0安装问题 - 新的控制器问题

时间:2011-04-08 11:28:31

标签: php .htaccess controller kohana config

我一直在尝试在我自己的WAMP服务器上安装Kohana但是已经遇到了一些死胡同。我按照here的说明进行操作,直到.htaccess文件修改为止; 我按指定重定向,但后来得到一个'内部服务器错误',说明这是一个配置错误。我尝试过一堆组合,但仍然会遇到同样的错误。

我发现的唯一工作方法是不包含.htaccess文件,只需将bootstrap.php正确指向正确的路径即可。 这将呈现我的welcome.php控制器示例,然后,我尝试创建一个新控制器,如上所述并输入特定路径(mysite / controller_name),但我得到404错误。

我出错的任何想法?

bootstrap.php -

Kohana::init(array(
'base_url'      => '/shiftrunner/kohana-shiftrunner/', 
'index_file'    => ''
));

.htaccess -     #打开URL重写     RewriteEngine On

# Installation directory 
RewriteBase /shiftrunner/kohana-shiftrunner 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]

1 个答案:

答案 0 :(得分:0)

你的RewriteBase应该是/shiftrunner/kohana-shiftrunner/,带有以下斜杠,与你引导程序中的base_url完全相同。

index_file如果您不希望显示,则应设置为false,而不是''

如果上述方法无效,我也会尝试更换

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

RewriteRule .* index.php [L]
相关问题