yii2 - remove index.php from url

yii2
voted: 1
vote
php yii2 url

To remove index.php from url:

1. Add entry in urlManager like this:
 'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
        ],
2. Add .htaccess file with folowing content in web folder:
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
working url: not entered
version: 2
Leave a Comment:
Characters left:
No comments yet.