summaryrefslogtreecommitdiff
path: root/.htaccess
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-02-07 05:20:21 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-02-07 05:20:21 +0000
commit84d9994485ae1b0ea84c986ea69475c77a385b2b (patch)
tree13d3dae404fbbd41b41072d6e0c44eba3c8a1f9e /.htaccess
parent73c28090e36e2ade9c055f7da58767e57d935898 (diff)
downloadbrdo-84d9994485ae1b0ea84c986ea69475c77a385b2b.tar.gz
brdo-84d9994485ae1b0ea84c986ea69475c77a385b2b.tar.bz2
#581706 by c960657: Protect hidden directories (.git, .svn, etc.) in .htaccess.
Diffstat (limited to '.htaccess')
-rw-r--r--.htaccess17
1 files changed, 16 insertions, 1 deletions
diff --git a/.htaccess b/.htaccess
index 58a8bef79..ab8fe8d74 100644
--- a/.htaccess
+++ b/.htaccess
@@ -3,7 +3,7 @@
#
# Protect files and directories from prying eyes.
-<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl|svn-base)$|^(Entries.*|Repository|Root|Tag|Template|all-wcprops|entries|format)$">
+<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$">
Order allow,deny
</FilesMatch>
@@ -62,6 +62,21 @@ DirectoryIndex index.php index.html index.htm
<IfModule mod_rewrite.c>
RewriteEngine on
+ # Block access to "hidden" directories whose names begin with a period. This
+ # includes directories used by version control systems such as Subversion or
+ # Git to store control files. Files whose names begin with a period, as well
+ # as the control files used by CVS, are protected by the FilesMatch directive
+ # above.
+ #
+ # NOTE: This only works when mod_rewrite is loaded. Without mod_rewrite, it is
+ # not possible to block access to entire directories from .htaccess, because
+ # <DirectoryMatch> is not allowed here.
+ #
+ # If you do not have mod_rewrite installed, you should remove these
+ # directories from your webroot or otherwise protect them from being
+ # downloaded.
+ RewriteRule "(^|/)\." - [F]
+
# If your site can be accessed both with and without the 'www.' prefix, you
# can use one of the following settings to redirect users to your preferred
# URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option: