From 2dade15d83b9d0b105fcb35c9edd62bfeceece16 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 13 Dec 2013 10:04:41 +0100 Subject: Fix security rules in .htaccess preventing access to base URL without the ending slash (#1489477) --- .htaccess | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) (limited to '.htaccess') diff --git a/.htaccess b/.htaccess index 43ab5b04f..0342e0878 100644 --- a/.htaccess +++ b/.htaccess @@ -27,26 +27,16 @@ php_value session.gc_probability 1 RewriteEngine On RewriteRule ^favicon\.ico$ skins/larry/images/favicon.ico -# security rules -RewriteRule ^/?(\.git|SQL|bin|config|logs|temp|tests|program\/(include|lib|localization|steps)) - [F] -RewriteRule /?(README(.md)?|composer\.json-dist|composer\.json|package\.xml)$ - [F] +# security rules: +# - deny access to files not containing a dot or starting with a dot +# in all locations except installer directory +RewriteRule ^(?!installer)(\.?[^\.]+)$ - [F] +# - deny access to some locations +RewriteRule ^/?(\.git|\.tx|SQL|bin|config|logs|temp|tests|program\/(include|lib|localization|steps)) - [F] +# - deny access to some documentation files +RewriteRule /?(README\.md|composer\.json-dist|composer\.json|package\.xml)$ - [F] -# deny access to all files not containing a "." (dot) -# to block access to different README, Changelog, INSTALL, etc. -# files of various skins and plugins. - - # Apache 2.4 - - Require all denied - - # Apache 2.2 - - Order Allow,Deny - Deny from all - - - SetOutputFilter DEFLATE -- cgit v1.2.3