In addition to following the guide Using search engine and user friendly URLs, step by step, don’t forget the advice of ORey, that I solved on this way…
Most propably by your localhost apache configuration you need change the available sites in your host:
/etc/apache2/sites-available
In my case, just I have one web page in my localhost and for that one I used:
<Directory "/var/www/yii/myAppWeb/protected">
Options [b]All[/b]
AllowOverride [b]All[/b]
[b]Require all granted[/b]
</Directory>
Important: don’t forget restarting your apache server.