Modifying apache to prevent public accessibility of .git folder -


I've read that ".git folder is at the root level of the web site, and is probably accessible to the public. And to prevent unwanted clones of the repository, add your high-level .htaccess file to refuse web access: "

  # denies access to top-level GIT repositories : RewriteEngine On First of all, thanks Joe Moller!  

In my virtual host file, I have RewriteEngine On << code>

/ Code> Command with the following specs:

  & lt; VirtualHost *: 80 & gt; Rewit sign on rewrite% {SERVER_PORT}! 443 Rewriting Rules (. *) Https://www.mydomain.com/ [R] & lt; / VirtualHost & gt;   

Can I add the GIT rewrite rule to the SSL only after the rewrite rule:

  & lt; VirtualHost *: 80 & gt; Rewit sign on rewrite% {SERVER_PORT}! 443 Rev. Raul (. *) Https://www.mydomain.com/ [R] rewritele \ .git - [F, L] & lt; / VirtualHost & gt;   

Thanks!

It is easy to test to make sure this should work, though. Just try browsing on http://www.mydomain.com/.git and see if it works.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -