director

director

这家伙有点懒,还没写个性签名!

  • 财富值25
  • 威望值0
  • 总积分45

个人信息

  • 2015-04-27 已签到
    连续签到2天,获得了10个金钱
  • 2015-04-26 已签到
    连续签到1天,获得了5个金钱
  • 2015-04-21 已签到
    连续签到1天,获得了5个金钱
  • 最近在评估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/

试用期 等级规则
45/50
资料完整度
10/100
用户活跃度
10/100

Ta的关注

0

Ta的粉丝

0

Ta的访客

1