我们在前面分享了很多关于yii框架的知识,还专门制作了一个yii框架专题供大家学习。本文我们将实例讲述yii隐藏url中index.php的方法。分享给大家供大家参考,具体如下:
一、修改config/下的main.php里的:
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
立即学习“PHP免费学习笔记(深入)”;
'rules'=>array(
'
'
'
),
),
二、修改网站根目录下.htaccess文件内容如下:
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
以上内容就是Yii隐藏URL中index.php的方法,希望能帮助到大家。
相关推荐:











