1 进入Kohana Web目录,把 example.htaccess 改名为 .htaccess
AllowOverride all
Options FollowSymLinks
Order allow,deny
Allow from all
Satisfy all
ServerName www.example.com
DocumentRoot /var/www/example
ErrorLog /var/log/httpd/example.error_log
AllowOverride all
Options FollowSymLinks
Order allow,deny
Allow from all
Satisfy all
'index_file' => false
2 查看Apache配置文件(httpd.conf),确认已加载mod_rewrite模块
LoadModule rewrite_module modules/mod_rewrite.so
3 假设Kohana Web目录为 KOHANA_HOME,让Apache读取目录下的 .htaccess
比如我的虚拟主机配置如下:
4 修改Kohana的启动程序,隐藏index.php,application/bootstrap.php,
Kohana::init(array(
...