You can enable pretty URLs by adding the following code to your application components in config/web.php and configure custom URLs in 'rules':
'components' => [
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName'=>true,
'rules' => [
// your rules go here
'customURL'=>'my-controller/my-action'
],
If you wish to hide index.php as well, then set:
'showScriptName'=>false
and create an .htaccess file your /web directory with the following contents:
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
Documentation: http://www.yiiframework.com/doc-2.0/yii-web-urlmanager.html