Apache2 https and .htaccess Rewrite Engine
Problem: After installing Apache2 some local site, which has a .htaccess-file cannot be opened, and shows the error message: “Internal Server Error. The server encountered an internal error or misconfiguration and was unable to complete your request.”
The logfile /var/log/apache2/error.log says “/path/.htaccess: Invalid command ‘RewriteEngine’, perhaps misspelled or defined by a module not included in the server configuration”.
.htaccess has a line “RewriteEngine On” in it.
Solution: Enable mod_rewrite in the apache configuration, using:
sudo a2enmod rewrite
sudo systemctl restart apache2
see: stackoverflow
To disable use:
sudo a2dismod rewrite
sudo systemctl restart apache2
Prerequisite: Enable https for localhost
see letsencrypt
and gist.github.com/cecilemuller/
see: /usr/share/doc/apache2/README.Debian.gz