Kohana 3.0 installation problems - New controller issues

南楼画角 提交于 2019-12-12 06:59:02

问题


I've been trying to install Kohana on my own WAMP server but have been running into a bit of a dead end. I've followed the instructions here up until the .htaccess file modification; I redirect as specified but then get an 'internal sever error' stating that it is a configuration error. I've tried a bunch of combinations and I still get the same error.

The only working method I've found is not including the .htaccess file and simply correctly pointing the bootstrap.php to the right path. This renders my welcome.php controller example, however, I then try and create a new controller as mentioned and enter the specific path (mysite/controller_name) but I get 404 Error.

Any ideas where I'm going wrong?

bootstrap.php -

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

.htaccess - # Turn on URL rewriting 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:


Your RewriteBase should be /shiftrunner/kohana-shiftrunner/ with the following slash, exactly the same as base_url in your bootstrap.

index_file should be set to false if you don't want it displayed, not ''.

If the above doesn't make it work, I'd also try replacing

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

with

RewriteRule .* index.php [L]


来源:https://stackoverflow.com/questions/5594370/kohana-3-0-installation-problems-new-controller-issues

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!