I have started learning yii2 and I tried to do pretty URL stuff, but failed. What I did:-
in config/web.php (I have edited below):
\
Why dont you just give the rules in your web.php file? like below:
'urlManager' => [
'class' => 'yii\web\UrlManager',
// Disable index.php
'showScriptName' => false,
// Disable r= routes
'enablePrettyUrl' => true,
'rules' => array(
'/' => '/view',
'//' => '/',
'/' => '/',
),
],
The rules i set here is only an example, you can set it the way you want your url to look like.
EDIT: If its not still working, try to set a virtualhost instead with:
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
Allow from 127.0.0.1 localhost