Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3101671
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3101671
Commits
84d99944
Commit
84d99944
authored
15 years ago
by
Angie Byron
Browse files
Options
Downloads
Patches
Plain Diff
#581706
by c960657: Protect hidden directories (.git, .svn, etc.) in .htaccess.
parent
73c28090
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.htaccess
+16
-1
16 additions, 1 deletion
.htaccess
with
16 additions
and
1 deletion
.htaccess
+
16
−
1
View file @
84d99944
...
...
@@ -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:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment