<Directory /var/www/html> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory>
<Directory /var/www/html> Options FollowSymLinks AllowOverride All Require all granted </Directory>
Next, I wanted to prevent some directories from being served. E.g. any git directories, and a directory where I could put stuff that PHP could find … e.g. my contact details file, but what I wouldn’t want to serve directly or include in files I might put on GitHub.
<IfModule mod_rewrite.c> RedirectMatch 404 /\.git RedirectMatch 404 /xprotected RedirectMatch 404 /git.token </IfModule>
And finally, some folders – like the “xprotected” directory, are to be ignored by Git …/.git/info/exclude: