frontend/config/_urlManager.php
<?php
/*
* This file is part of the HomeFinanceV2 project.
*
* (c) Rafalsky.com <http://github.com/Rafalsky/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
'class' => 'yii\web\UrlManager',
'enablePrettyUrl'=>true,
'showScriptName'=>false,
'rules'=> [
// Pages
['pattern' => 'page/<slug>', 'route' => 'page/view'],
// Articles
['pattern' => 'article/index', 'route' => 'article/index'],
['pattern' => 'article/attachment-download', 'route' => 'article/attachment-download'],
['pattern' => 'article/<slug>', 'route' => 'article/view'],
// Api
['class' => 'yii\rest\UrlRule', 'controller' => 'api/v1/article', 'only' => ['index', 'view', 'options']],
['class' => 'yii\rest\UrlRule', 'controller' => 'api/v1/user', 'only' => ['index', 'view', 'options']]
]
];