您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

yii index.php隐藏的设置方法

2024/8/12 12:13:49发布47次查看
yii index.php隐藏的设置方法: 首先开启apache的rewrite模块;然后去掉rewrite前的“#”符号;接着建立“.htaccess”文件;最后修改yii的配置文件“mail.php”即可。
yii 隐藏index.php
首先,开启apache的rewrite模块
    去掉rewrite前的#,如下所示
loadmodule rewrite_module modules/mod_rewrite.so
接着,在yii的index.php同级目录建立.htaccess文件,内容如下
<ifmodule mod_rewrite.c> 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 </ifmodule>
最后,在yii的配置文件mail.php 中添加
'urlmanager'=>array( 'urlformat'=>'path', 'showscriptname'=>false, 'rules'=>array( '<controller:\w+>/<id:\d+>'=>'<controller>/view', '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>', '<controller:\w+>/<action:\w+>'=>'<controller>/<action>', ), ),
这样就隐藏了index.php
推荐学习:《yii教程》
以上就是yii index.php隐藏的设置方法的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product