来源:未知 时间:2014-12-13 18:40 作者:xxadmin 阅读:次
[导读] 1.开启apache的mod_rewrite模块 去掉LoadModule rewrite_module modules/mod_rewrite.so前的#符号 确保Directory .../Directory中有AllowOverride All 2.在项目中的/protected/config/main.php中添加代码: ----------------------...
1.开启apache的mod_rewrite模块
去掉LoadModule rewrite_module modules/mod_rewrite.so前的“#”符号 确保<Directory "..."></Directory>中有“AllowOverride All” 2.在项目中的/protected/config/main.php中添加代码: ----------------------------------------------------------------------------- 'components'=>array( ... 'urlManager'=>array( 'urlFormat'=>'path', 'showScriptName'=>false,//注意false不要用引号括上 'urlSuffix'=>'.html', 'rules'=>array( 'sites'=>'site/index', ), ), ... ), ------------------------------------------------------------------------------ 3.在与index.php文件同级目录下添加文件“.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 |
自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习
京ICP备14009008号-1@版权所有www.zixuephp.com
网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com