我们在前面分享了很多关于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的方法,希望能帮助到大家。
相关推荐:
以上就是Yii如何隐藏URL中index.php的详细内容,更多请关注php中文网其它相关文章!
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号