Apache2 – VirtualHost with .htaccess Create a virtual host configuration file: Activate the "mod_rewrite" module: And restart Apache2: