First of all enable mod_rewrite then restart apache2 using following commands:
sudo a2enmod rewrite
sudo service apache2 restart
then open apache conf file using command:
sudo gedit /etc/apache2/apache2.conf
uncomment below line if it is commented
AccessFileName .htaccess
then find these lines in apache2.conf
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
here change the line AllowOverride None to AllowOverride All and save this file.
Now, your issue is resolved.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…