Kohana URL重写 [英] Kohana URL rewriting

查看:92
本文介绍了Kohana URL重写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了Kohana,当我开始编辑Kohana :: init和.htaccess以使其在没有'/index.php/'的情况下工作时,出现了一个问题.

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/'

这就是我在做什么.

我的操作系统是Ubuntu linux 10.04

My OS is Ubuntu linux 10.04

我已将Kohana :: init'base_url'参数更改为'/kohana/',并且在.htaccess中RewriteBase相同

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

还在Kohana :: init上添加了'index_file =>''

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

但是现在不起作用

它适用于 http://localhost/kohana/

但不适用于 http://localhost/custom/change

但是,它仍然适用于 http://localhost/index.php/custom/change

也许.htaccess根本不起作用?在Ubuntu上,从(.)点开始的文件被隐藏.现在被隐藏了.

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

所以我花了2个小时来修复它,但仍然不知道问题出在哪里.

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.

推荐答案

检查Apache httpd.conf/vhost.conf中的AllowOverride All,否则将不会读取.htaccess文件.默认情况下它是禁用的. (没人知道为什么.)

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.)

否则,发布您的RewriteRule集.否则只是猜测.

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

这篇关于Kohana URL重写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆