Is it a Yii error page that you see or an error page from your webserver (Apache, nginx, …)?
In the latter case the server probably ignores your .htaccess file. That’s pretty common. For Apache you can allow .htaccess files by adding this to your VirtualHost section in the Apache config file:
<Directory "/path/to/your/webroot">
AllowOverride All
</Directory>
You may already have such a Directory block in your config. It’s fine to add AllowOverride All there.
Alternatively you can also add the required mod_rewrite rules directly to the config file (which is slightly faster, because Apache doesn’t have to look for changed .htaccess files on every request).