Kohana URL rewriting

旧街凉风 提交于 2020-01-25 08:39:06

问题


I've installed Kohana and there is a problem appear, when I started to edit Kohana::init and .htaccess to make it work with no '/index.php/'

Here is what I'm doing.

My OS is Ubuntu linux 10.04

I've changed Kohana::init 'base_url' param to '/kohana/' and on .htaccess RewriteBase is the same

Also added 'index_file => '' on Kohana::init

But now it is not working

It works for http://localhost/kohana/

but do not works for http://localhost/custom/change

however, it still works for http://localhost/index.php/custom/change

Maybe .htaccess do not work at all? On Ubuntu files that starts from (.) point become hidden. and it is now hidden.

So I spent 2 hours trying to fix it, but still do not know where is the problem.

Will be happy, if someone here can spend his time trying to fix it.


回答1:


Check your Apache httpd.conf/vhost.conf for AllowOverride All, else .htaccess files won't be read. It's disabled per default. (Nobody knows why.)

Otherwise post your RewriteRule set. Else it's just guessing.



来源:https://stackoverflow.com/questions/3689822/kohana-url-rewriting

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