Kohana如何去掉URL中ci框架去掉index.phpp

君,已阅读到文档的结尾了呢~~
扫扫二维码,随身浏览文档
手机或平板扫扫即可继续访问
Kohana_3_中文译本
举报该文档为侵权文档。
举报该文档含有违规或不良信息。
反馈该文档无法正常浏览。
举报该文档为重复文档。
推荐理由:
将文档分享至:
分享完整地址
文档地址:
粘贴到BBS或博客
flash地址:
支持嵌入FLASH地址的网站使用
html代码:
&embed src='/DocinViewer-4.swf' width='100%' height='600' type=application/x-shockwave-flash ALLOWFULLSCREEN='true' ALLOWSCRIPTACCESS='always'&&/embed&
450px*300px480px*400px650px*490px
支持嵌入HTML代码的网站使用
您的内容已经提交成功
您所提交的内容需要审核后才能发布,请您等待!
3秒自动关闭窗口php - kohana3.3 Route::url() not working very well - Stack Overflow
Join the Stack Overflow Community
Stack Overflow is a community of 6.9 million programmers, just like you, helping each other.
J it only takes a minute:
route setting:
Route::set('home', '(&action&)(_&p&.htm)',
'action' =& '(movie|tv|new)',
'p' =& '[2-9]|[1-9][0-9]+'
)-&defaults(
'controller' =& 'Home',
'action' =& 'index',
get a url by Route::url():
Route::url('home',array('action' =& 'movie', 'p' =& 3));
got a url:
http:// /movie_3.htm
working very well.
Route::url('home',array('action' =& 'movie'));
got a url:
http:// /movie_1.htm
this is not right .
it should be:
http:// /movie/
how can i fix it ????
=====update 8/19 16:23 =====
Route::set('test', 'movie(_&p&.htm)',
array('p' =& '[2-9]|[1-9][0-9]+')
)-&defaults(
array('controller' =& 'Movie', 'action' =& 'index', 'p' =& '1')
this route setting works well in any situation
Route::url('test',array('p'=&'1'));
got a url:
Route::url('test',array('p'=&'2'));
got a url:
/movie_2.htm
Route::url('test');
got a url:
= =,is there a bug in kohana core ???
18.3k64788
I think you should remove "p" parameter from defaults and validators. So your code should looks like this:
Route::set('home', '(&action&)(_&p&.htm)',
'action' =& '(movie|tv|new)'
)-&defaults(
'controller' =& 'Home',
'action' =& 'index'
I am not pretty sure about removing p from defaults so you can try to add it back
Your Answer
Sign up or
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Post as a guest
By posting your answer, you agree to the
Not the answer you're looking for?
Browse other questions tagged
rev .25478
Stack Overflow works best with JavaScript enabled浏览次数:3409
前一篇日志记录了Kohana session的用法,不过用的是默认的native适配器,如果你想使用database适配器session数据存储到数据表,配置就稍微复杂点。第一步:需要你启用Datab...
浏览次数:7462
个人Kohana框架Session和Cookie使用教程,欢迎留言。一.Kohana中Session使用:Session::instance()-&set('a', 'this is value...
浏览次数:4775
Kohana 3.3 分页跟之前的版本几乎没什么区别,只是好像Kohana框架默认没带Pagination module(分页模块),你可以点击这里下载.第一步:在bootstap.php中开启分页模...
浏览次数:4244
Kohana rewrite去掉URL中index.php教程:第一步:打开bootstrap.php添加初始化配置'index_file' =& FALSEKohana::init(array...
浏览次数:5025
差点混淆了,看了半天,原来主要有两个控制器Controller和Controller_Template,这两者加载视图,传递变量是不同的,前者:&?php
class Controller...
浏览次数:5337
Kohana 表单验证Validation官方教程写的有点粗糙,我也是看了半天才明白。本教程是连载教程,数据还是上一讲的数据结构(Kohana ORM)第一步:在application/model/a...
浏览次数:4540
Kohana ORM对象有4种关系类型:belongs_to(多对一), has_many(一对多), has_many "through"(多对多)和 has_one(一对一).他们的用法也比较简单...
浏览次数:9341
Kohana毫无疑问是我看到的最喜欢的框架,轻量级,有比CI多了module和ORM,很荣幸下个项目可以用它了,看了下Kohana ORM操作教程,贴出来了。第一步:需要你在application/b...Kohana如何去掉URL中index.php_PHP教程_ThinkSAAS
Kohana如何去掉URL中index.php
Kohana如何去掉URL中index.php
内容来源: 网络
Kohana rewrite去掉URL中index.php教程:第一步:打开bootstrap.php添加初始化配置&index_file& =& FALSEKohana::init(array(
&base_url&
=& &/kohana/&,
&index_file& =& FALSE
));第二步:直接将kohana中的example.htaccess改为.htaccess 即可,根据你的实际情况修改RewriteBaseRewriteEngine On
RewriteBase /kohana/
&Files .*&
Order Deny,Allow
Deny From All
RewriteRule ^(?:application|modules|system).* index.php/$0 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT]
PHP开发框架
开发工具/编程工具
服务器环境
ThinkSAAS商业授权:
ThinkSAAS为用户提供有偿个性定制开发服务
ThinkSAAS将为商业授权用户提供二次开发指导和技术支持
让ThinkSAAS更好,把建议拿来。
开发客服微信}

我要回帖

更多关于 iis去掉index.php 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信