Magento and .git directory hiding

If you’re deploying a Magento website using git you surely do not want the .git directory to be visible from the browser, so just put this line in your .htaccess:

RewriteRule .*\.git/.* - [F]

right after:

RewriteEngine on

let’s have a nice day now :)

Leave a Reply

Your email address will not be published. Required fields are marked *