I just incidentally deleted
/etc/apache2/mods-available/rewrite.load how do I restore it? I tried
apt reinstall apache2, but it did not help.
It's just a text file with the following content in Xenial:
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
You can look for the file in here.
It is the piece of configuration that loads the binary module responsible for URL rewriting (the .so file). Apache (Nginx does that too) stores these files in a "mods-available" directory, so you can enable and disable it at will. To enable a module, you should create a symbolic link pointing to the .load file inside the "mods-enabled", or use the a2enmod utility, like that:
sudo a2enmod rewrite sudo systemctl restart apache2.service
To disable a module, use:
sudo a2dismod rewrite sudo systemctl restart apache2.service
If you pay attention, you'll see that the a2dismod/a2enmod deletes/creates the symbolic link for you.
In the end, it's just a way to make Apache's configuration more dynamic and easier to manage.