I'm new to yii and have just installed 2.0.18-dev version. I'm on MacOS with Apache.

I'm trying to enable pretty url but it shows error:

http://localhost/yii/web/site/about

Not Found The requested URL /yii/web/site/about was not found on this server.

I've searched for answer but there are so many conflicting solution.

How to fix it in simplest way?

I've done followings:

1) web.php

uncommented following block

     'urlManager' => [
        'enablePrettyUrl' => true,
        'showScriptName' => false,
        'rules' => [
        ],
    ],

2) Web root .htaccess

Options +FollowSymLinks
IndexIgnore */*
RewriteEngine On
     RewriteCond %{REQUEST_URI} !^/(web)
    RewriteRule ^assets/(.*)$ /web/assets/$1 [L]
    RewriteRule ^css/(.*)$ web/css/$1 [L]
    RewriteRule ^js/(.*)$ web/js/$1 [L]
    RewriteRule ^images/(.*)$ web/images/$1 [L]
    RewriteRule (.*) /web/$1
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /web/index.php

3) /web/.htaccess

RewriteEngine On RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . index.php

0 Answers