If you want to configure the rewrite mode in Apache2, you must to execute this command in a terminal:
~$ sudo a2enmod rewrite
After this command, you must restart the apache web server:
~$ sudo /etc/init.d/apache2 restart
Or:
~$ sudo systemctl restart apache2
- To create a virtual host for a custom website, rename the "000-default.conf" file with the domain name of the website. Eg: mywebsite.com.conf.
- Put the configuration file into the folder /etc/apache2/sites-available.
- Execute this command in a terminal, and then restart the apache web server:
~$ sudo a2ensite mywebsite.com.conf
- Happy hacking!