You need to add the following line into your Apache config file:
AddType application/x-httpd-php .htm .html
You also need two other things:
Allow Overridding
In your_site.conf
file (e.g. under /etc/apache2/mods-available
in my case), add the following lines:
<Directory "<path_to_your_html_dir(in my case: /var/www/html)>">
AllowOverride All
</Directory>
Enable Rewrite Mod
Run this command on your machine:
sudo a2enmod rewrite
After any of those steps, you should restart apache:
sudo service apache2 restart