If .htaccess is not working on your Apache it is possible that it is not enabled. To enable .htaccess on Apache edit following file:
Locate following line:
and replace it with:
Finally – run following two commands
sudo a2enmod rewrite sudo /etc/init.d/apache2 restart
Notice: This instruction on how to enable .htaccess on Apache is meant only for Apache2.