The .htaccess enables the directory level configuration for the Apache server. This allows users to override the Apache global and virtual host settings.

Enable .htaccess in Apache

Edit Apache virtual host configuration file in your favorite editor and add the following Directory tag. Update /var/www/html with your application document root.

The first directory tag will disable using of .htaccess in /var/www directory. The second directory tag will enable the use of .htaccess under /var/www/html directory.