diff options
author | VirtualTam <virtualtam@flibidi.net> | 2018-01-20 16:20:53 +0100 |
---|---|---|
committer | VirtualTam <virtualtam@flibidi.net> | 2018-02-05 18:18:52 +0100 |
commit | cabf1b6becbc0143f6a9d0d6846fd948c06b5a64 (patch) | |
tree | 5e0671ed51d327b755cd90de449fd3e9463404bd | |
parent | 91f17fc92a7168e2baf1096910b8f44f3a24a8a2 (diff) | |
download | Shaarli-cabf1b6becbc0143f6a9d0d6846fd948c06b5a64.tar.gz Shaarli-cabf1b6becbc0143f6a9d0d6846fd948c06b5a64.tar.zst Shaarli-cabf1b6becbc0143f6a9d0d6846fd948c06b5a64.zip |
htaccess: prevent accessing resources not managed by SCM
See:
- https://en.internetwache.org/dont-publicly-expose-git-or-how-we-downloaded-your-websites-sourcecode-an-analysis-of-alexas-1m-28-07-2015/
- https://stackoverflow.com/questions/2530372/how-do-i-disable-directory-browsing
- https://httpd.apache.org/docs/current/mod/mod_rewrite.html
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
-rw-r--r-- | .htaccess | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -1,4 +1,12 @@ | |||
1 | # Disable directory listing | ||
2 | Options -Indexes | ||
3 | |||
1 | RewriteEngine On | 4 | RewriteEngine On |
5 | |||
6 | # Prevent accessing subdirectories not managed by SCM | ||
7 | RewriteRule ^(.git|doxygen|vendor) - [F] | ||
8 | |||
9 | # REST API | ||
2 | RewriteCond %{REQUEST_FILENAME} !-f | 10 | RewriteCond %{REQUEST_FILENAME} !-f |
3 | RewriteCond %{REQUEST_FILENAME} !-d | 11 | RewriteCond %{REQUEST_FILENAME} !-d |
4 | RewriteRule ^ index.php [QSA,L] | 12 | RewriteRule ^ index.php [QSA,L] |