director
- director 2015-04-27 已签到连续签到2天,获得了10个金钱
- director 2015-04-26 已签到连续签到1天,获得了5个金钱
- director 2015-04-21 已签到连续签到1天,获得了5个金钱
- director 回复了话题 YII2.0 去掉index.php
最近在评估YII 2.0,实现perfy url的步骤如下 1 和 2
1.在 index.php 同级目录建立 .htaccess 文件 ,设置内容: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`
2.为 config目录的web.php 增加配置项 urlManager,代码:
'urlManager' => [ 'class' => 'yii\web\UrlManager', // Disable index.php 'showScriptName' => false, // Disable r= routes 'enablePrettyUrl' => true, 'rules' => array( ), ],
以上2个步骤下来,There is Pretty URL ! ~(≧▽≦)/~
内容引用源:http://www.bsourcecode.com/yiiframework2/removing-index-php-from-url-in-yiiframework-2-0/