Hiding HTML File Extension in URL with Apache mod_rewrite on Ubuntu 14.04

Enable the mod_rewrite module using the a2enmod command. If you can’t remember the specific name of the module you are trying to enable, you can ls /etc/apache2/mods-available/ or if you’d like to see if the module is already active you can take a look at /etc/apache2/mods-enabled/.

In /etc/apache2/sites-enabled/000-default.conf you’ll need to add the following directives inside of the proper VirtualHost. If you’re using PHP, you can substitute $1.html for $1.php.

After you restart Apache you’ll be able to omit html file extensions from your URLs.