If your apache version is 2.4 then you have to edit apache configuration in /etc/apache2/apache2.conf
. Find
<Directory /var/www/>
and change the block like this :
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
After that, restart apache.
service apache2 reload
source : https://askubuntu.com/questions/421233/enabling-htaccess-file-to-rewrite-path-not-working