泛舟湖上清波郎朗
首先,开启apache的rewrite模块去掉rewrite前的#,如下所示LoadModule rewrite_module modules/mod_rewrite.so接着,在yii的index.php同级目录建立.htaccess文件,内容如下Options +FollowSymLinksIndexIgnore */*RewriteEngine on# if a directory or a file exists, use it directlyRewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-d# otherwise forward it to index.phpRewriteRule . index.php最后,在yii的配置文件mail.php 中添加'urlManager'=>array('urlFormat'=>'path','showScriptName'=>false,'rules'=>array('/'=>'/view','//'=>'/','/'=>'/',),),