diff options
| author | polo <ordipolo@gmx.fr> | 2026-01-12 20:17:20 +0100 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2026-01-12 20:17:20 +0100 |
| commit | cefcba981d593b271fc28ff035f2be06ebeab923 (patch) | |
| tree | 5bfaabb0b80a13f949c2b5db9c193be371b486c9 | |
| parent | 505cab0210e83bf62085b665abad0698a8d31352 (diff) | |
| download | cms-cefcba981d593b271fc28ff035f2be06ebeab923.tar.gz cms-cefcba981d593b271fc28ff035f2be06ebeab923.tar.bz2 cms-cefcba981d593b271fc28ff035f2be06ebeab923.zip | |
htaccess dans media fonctionnel avec php module apache ou fastCGI, htaccess dans les dossiers des images
| -rw-r--r-- | public/user_data/assets/.htaccess | 24 | ||||
| -rw-r--r-- | public/user_data/images-mini/.htaccess | 24 | ||||
| -rw-r--r-- | public/user_data/images/.htaccess | 24 | ||||
| -rw-r--r-- | public/user_data/media/.htaccess | 22 |
4 files changed, 91 insertions, 3 deletions
diff --git a/public/user_data/assets/.htaccess b/public/user_data/assets/.htaccess new file mode 100644 index 0000000..6055667 --- /dev/null +++ b/public/user_data/assets/.htaccess | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | # désactive tout traitement par le handler apache (PHP, CGI, etc.) | ||
| 2 | SetHandler None | ||
| 3 | |||
| 4 | # scripts CGI (perl, python) | ||
| 5 | # complète le blocage du handler apache | ||
| 6 | Options -ExecCGI | ||
| 7 | # (php qui utilise mod_php (module apache) ou php-fpm (fastCGI) n'est pas concerné par cette règle) | ||
| 8 | |||
| 9 | # exploration des dossiers | ||
| 10 | Options -Indexes | ||
| 11 | |||
| 12 | # protection par whitelist | ||
| 13 | Require all denied | ||
| 14 | <FilesMatch "\.(jpe?g|png|gif|webp|tiff?)$"> | ||
| 15 | Require all granted | ||
| 16 | </FilesMatch> | ||
| 17 | |||
| 18 | |||
| 19 | ## moins utile | ||
| 20 | |||
| 21 | # interdire l'accès direct aux fichiers .htaccess et .htpasswd (déjà bloqués normallement) | ||
| 22 | <FilesMatch "^\.(htaccess|htpasswd)$"> | ||
| 23 | Require all denied | ||
| 24 | </FilesMatch> \ No newline at end of file | ||
diff --git a/public/user_data/images-mini/.htaccess b/public/user_data/images-mini/.htaccess new file mode 100644 index 0000000..6055667 --- /dev/null +++ b/public/user_data/images-mini/.htaccess | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | # désactive tout traitement par le handler apache (PHP, CGI, etc.) | ||
| 2 | SetHandler None | ||
| 3 | |||
| 4 | # scripts CGI (perl, python) | ||
| 5 | # complète le blocage du handler apache | ||
| 6 | Options -ExecCGI | ||
| 7 | # (php qui utilise mod_php (module apache) ou php-fpm (fastCGI) n'est pas concerné par cette règle) | ||
| 8 | |||
| 9 | # exploration des dossiers | ||
| 10 | Options -Indexes | ||
| 11 | |||
| 12 | # protection par whitelist | ||
| 13 | Require all denied | ||
| 14 | <FilesMatch "\.(jpe?g|png|gif|webp|tiff?)$"> | ||
| 15 | Require all granted | ||
| 16 | </FilesMatch> | ||
| 17 | |||
| 18 | |||
| 19 | ## moins utile | ||
| 20 | |||
| 21 | # interdire l'accès direct aux fichiers .htaccess et .htpasswd (déjà bloqués normallement) | ||
| 22 | <FilesMatch "^\.(htaccess|htpasswd)$"> | ||
| 23 | Require all denied | ||
| 24 | </FilesMatch> \ No newline at end of file | ||
diff --git a/public/user_data/images/.htaccess b/public/user_data/images/.htaccess new file mode 100644 index 0000000..6055667 --- /dev/null +++ b/public/user_data/images/.htaccess | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | # désactive tout traitement par le handler apache (PHP, CGI, etc.) | ||
| 2 | SetHandler None | ||
| 3 | |||
| 4 | # scripts CGI (perl, python) | ||
| 5 | # complète le blocage du handler apache | ||
| 6 | Options -ExecCGI | ||
| 7 | # (php qui utilise mod_php (module apache) ou php-fpm (fastCGI) n'est pas concerné par cette règle) | ||
| 8 | |||
| 9 | # exploration des dossiers | ||
| 10 | Options -Indexes | ||
| 11 | |||
| 12 | # protection par whitelist | ||
| 13 | Require all denied | ||
| 14 | <FilesMatch "\.(jpe?g|png|gif|webp|tiff?)$"> | ||
| 15 | Require all granted | ||
| 16 | </FilesMatch> | ||
| 17 | |||
| 18 | |||
| 19 | ## moins utile | ||
| 20 | |||
| 21 | # interdire l'accès direct aux fichiers .htaccess et .htpasswd (déjà bloqués normallement) | ||
| 22 | <FilesMatch "^\.(htaccess|htpasswd)$"> | ||
| 23 | Require all denied | ||
| 24 | </FilesMatch> \ No newline at end of file | ||
diff --git a/public/user_data/media/.htaccess b/public/user_data/media/.htaccess index 4494297..41f632b 100644 --- a/public/user_data/media/.htaccess +++ b/public/user_data/media/.htaccess | |||
| @@ -1,10 +1,26 @@ | |||
| 1 | # désactiver l'interpréteur PHP | 1 | # désactive tout traitement par le handler apache (PHP, CGI, etc.) |
| 2 | php_flag engine off | 2 | SetHandler None |
| 3 | |||
| 4 | # scripts CGI (perl, python) | ||
| 5 | # complète le blocage du handler apache | ||
| 6 | Options -ExecCGI | ||
| 7 | # (php qui utilise mod_php (module apache) ou php-fpm (fastCGI) n'est pas concerné par cette règle) | ||
| 3 | 8 | ||
| 4 | # exploration des dossiers | 9 | # exploration des dossiers |
| 5 | Options -Indexes | 10 | Options -Indexes |
| 6 | 11 | ||
| 7 | # interdire l'accès directaux fichiers .htaccess et .htpasswd | 12 | |
| 13 | ## moins utile | ||
| 14 | |||
| 15 | # interdire l'accès direct aux fichiers .htaccess et .htpasswd (déjà bloqués normallement) | ||
| 8 | <FilesMatch "^\.(htaccess|htpasswd)$"> | 16 | <FilesMatch "^\.(htaccess|htpasswd)$"> |
| 9 | Require all denied | 17 | Require all denied |
| 10 | </FilesMatch> | 18 | </FilesMatch> |
| 19 | |||
| 20 | # supprime des associations extension/handler | ||
| 21 | RemoveHandler .php .phtml .php3 .php4 .php5 .php7 .php8 .phar | ||
| 22 | |||
| 23 | # fichiers php non accessibles (en plus d'être non exécutables) | ||
| 24 | <FilesMatch "\.(php|phtml|php[0-9]|phar)$"> | ||
| 25 | Require all denied | ||
| 26 | </FilesMatch> \ No newline at end of file | ||
