{"id":821,"date":"2013-01-11T02:03:27","date_gmt":"2013-01-11T02:03:27","guid":{"rendered":"http:\/\/www.nooblet.org\/blog\/?p=821"},"modified":"2013-07-12T21:58:52","modified_gmt":"2013-07-12T21:58:52","slug":"blocking-git-and-svn-folders-on-apache","status":"publish","type":"post","link":"https:\/\/www.nooblet.org\/blog\/2013\/blocking-git-and-svn-folders-on-apache\/","title":{"rendered":"Block .git and .svn folders on Apache"},"content":{"rendered":"<p>Add the following to &lt;VirtualHost>,<\/p>\n<blockquote><p><code># Deny access to git\/svn files<br \/>\n&lt;Directorymatch \"^\/(.*\/)*\\.(git|svn)\/\"><br \/>\n  Order deny,allow<br \/>\n   Deny from all<br \/>\n&lt;\/Directorymatch><\/code><\/p><\/blockquote>\n<p>According to <a href=\"http:\/\/serverfault.com\/a\/251003\" target=\"_blank\">this answer<\/a>, a .htaccess file with this will do the same,<\/p>\n<blockquote><p><code>RewriteEngine On<br \/>\nRewriteRule \"^(.*\/)?\\.(git|svn)\/\" - [F,L]<\/code><\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Add the following to &lt;VirtualHost>, # Deny access to git\/svn files &lt;Directorymatch &#8220;^\/(.*\/)*\\.(git|svn)\/&#8221;> Order deny,allow Deny from all &lt;\/Directorymatch> According to this answer, a .htaccess file with this will do the same, RewriteEngine On RewriteRule &#8220;^(.*\/)?\\.(git|svn)\/&#8221; &#8211; [F,L]<\/p>\n","protected":false},"author":1,"featured_media":828,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[185,188,186,187],"class_list":["post-821","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-other","tag-apache","tag-block","tag-git","tag-svn"],"_links":{"self":[{"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/posts\/821","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/comments?post=821"}],"version-history":[{"count":11,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/posts\/821\/revisions"}],"predecessor-version":[{"id":861,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/posts\/821\/revisions\/861"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/media\/828"}],"wp:attachment":[{"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/media?parent=821"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/categories?post=821"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nooblet.org\/blog\/wp-json\/wp\/v2\/tags?post=821"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}