黑马程序员技术交流社区

标题: 【上海校区】Kohana如何去掉URL中index.php [打印本页]

作者: 梦缠绕的时候    时间: 2019-2-19 11:06
标题: 【上海校区】Kohana如何去掉URL中index.php
Kohana rewrite去掉URL中index.php教程:

第一步:打开bootstrap.php添加初始化配置'index_file' => FALSE

Kohana::init(array(        'base_url'   => '/kohana/',        'errors'     => TRUE,        'index_file' => FALSE));

第二步:直接将kohana中的example.htaccess改为.htaccess 即可,根据你的实际情况修改RewriteBase

RewriteEngine OnRewriteBase /kohana/        Order Deny,Allow        Deny From AllRewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L]RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule .* index.php/$0 [PT]

作者: 不二晨    时间: 2019-2-20 09:25
今天也要加油鸭




欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2