mod_rewrite 启用时 Kohana detector_uri() 出现问题
当请求的控制器是索引时,我在检测当前 uri 时遇到问题。 (我的index_file
文件名是index.php)。问题似乎出在 detector_uri() 函数中,因为它在 REQUEST_URI
之前检查 PATH_INFO
。当我的网址为 http://localhost/myapp/index/ $_SERVER['PATH_INFO'] 返回 /
当它是 http://localhost/myapp/index/ index/ 时,它返回 <代码>/索引。对于所有其他控制器请求,它返回空并且系统工作正常。我使用的是 Ubuntu 10.10。我认为在 Debian 系统中启用 mod_rewrite 时,$_SERVER['PATH_INFO']
不会返回预期值。请有人解释一下。
谢谢
I am having problem in detecting current uri when the requested controller is index. (my index_file
file name is index.php). It seems the problem is in detect_uri() function since it checks PATH_INFO
before REQUEST_URI
. when my url is http://localhost/myapp/index/ $_SERVER['PATH_INFO'] returns /
and when it's http://localhost/myapp/index/ index/ it returns /index
. For all other controllers requests it returns empty and the system works fine. I am using Ubuntu 10.10. I think when mod_rewrite is enabled in Debian system, $_SERVER['PATH_INFO']
does not returns the expected value. someone please explain.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
与
mod_negotiation
相关,并能够以/index
方式访问/index.php
(不带扩展名)。解决方案1:
解决方案2:
http://pastebin.com/7EtGGiaG
Related to
mod_negotiation
and being able to access/index.php
as/index
(without the extension).Solution1:
Solution2:
http://pastebin.com/7EtGGiaG