aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVirtualTam <virtualtam@flibidi.net>2018-01-20 16:20:53 +0100
committerVirtualTam <virtualtam@flibidi.net>2018-03-25 19:41:39 +0200
commit4c2f51256f2c914a10c0c7aa59311c5862d2a480 (patch)
tree7c6657c2998adbdd15c1fa0a70383fb8bfc9820b
parent06ca7c102ba058d99f19e614023c539dbdb58b36 (diff)
downloadShaarli-4c2f51256f2c914a10c0c7aa59311c5862d2a480.tar.gz
Shaarli-4c2f51256f2c914a10c0c7aa59311c5862d2a480.tar.zst
Shaarli-4c2f51256f2c914a10c0c7aa59311c5862d2a480.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--.htaccess8
1 files changed, 8 insertions, 0 deletions
diff --git a/.htaccess b/.htaccess
index 66ef8f69..19dd72a8 100644
--- a/.htaccess
+++ b/.htaccess
@@ -1,4 +1,12 @@
1# Disable directory listing
2Options -Indexes
3
1RewriteEngine On 4RewriteEngine On
5
6# Prevent accessing subdirectories not managed by SCM
7RewriteRule ^(.git|doxygen|vendor) - [F]
8
9# REST API
2RewriteCond %{REQUEST_FILENAME} !-f 10RewriteCond %{REQUEST_FILENAME} !-f
3RewriteCond %{REQUEST_FILENAME} !-d 11RewriteCond %{REQUEST_FILENAME} !-d
4RewriteRule ^ index.php [QSA,L] 12RewriteRule ^ index.php [QSA,L]