Kohana URL重写

编程入门 行业动态 更新时间:2024-10-07 18:21:12
本文介绍了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

但是现在不起作用

它适用于 localhost/kohana/

但不适用于 localhost/custom/change

但是,它仍然适用于 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重写

本文发布于:2023-11-02 06:18:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1551599.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:重写   Kohana   URL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!