Solution:
Possibly AllowOverride All is not set in your apache config file, you can enable it by editing vhosts or apache config(httpd.conf) file.
here is a sample configuration
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Change
AllowOverride None
to
AllowOverride All