diff --git a/.htaccess b/.htaccess index 865a7b2f..99084a1d 100755 --- a/.htaccess +++ b/.htaccess @@ -38,20 +38,30 @@ RewriteEngine on # Protect wp-config.php - deny from all + deny from all -# Protect .htaccess et .htpasswds - - order allow,deny - deny from all - +# @author JEREMY +# Protect hidden files + + Order allow,deny + Deny from all + -# Protect debug.log - - order allow,deny - deny from all - +# @author JEREMY +# Deny Everything in content folder except extensions +# css,jpeg,jpg,ico,png,gif,svg,js,eot,ttf,woff,woff2,mp4,mp3,ogg,ogv,mov,docx,doc,pdf,xml,html +RewriteRule ^content\/(.(?!.*\.css$|.*\.jpe?g$|.*\.ico$|.*\.png$|.*\.gif$|.*\.svg$|.*\.js$|.*\.eot$|.*\.ttf$|.*\.woff$|.*\.woff2$|.*\.mp4$|.*\.mp3$|.*\.ogg$|.*\.ogv$|.*\.mov$|.*\.docx$|.*\.doc$|.*\.pdf$|.*\.xml$|.*\.html$))*$ - [F] + +# @author JEREMY +# Deny everything in crons folder +RewriteRule ^crons\/.*$ - [F] + +# @author JEREMY +# Deny Everything in rgpd folder except needed +# css,jpeg,jpg,ico,png,gif,svg,js,eot,ttf,woff,woff2,mp4,mp3,ogg,ogv,mov,docx,doc,pdf,xml,html +# salaries/ consommateurs/ +RewriteRule ^rgpd\/(.(?!.*\.css$|.*\.jpe?g$|.*\.ico$|.*\.png$|.*\.gif$|.*\.svg$|.*\.js$|.*\.eot$|.*\.ttf$|.*\.woff$|.*\.woff2$|.*\.mp4$|.*\.mp3$|.*\.ogg$|.*\.ogv$|.*\.mov$|.*\.docx$|.*\.doc$|.*\.pdf$|.*\.xml$|.*\.html$|.*index\.php$|.*onsommateurs\/$|.*alaries\/$))*$ - [F] # Protect sql files @@ -73,9 +83,6 @@ RewriteEngine on Deny from all -# protection des fichiers sys -RedirectMatch 404 /\. - #Bloquer l'indexation des fichiers PDF Header set X-Robots-Tag "noindex, nofollow" @@ -893,11 +900,18 @@ RedirectPermanent /type/jeusselin/ https://www.ldc.fr/nous-connaitre/#nos-implan RedirectPermanent /type/s-n-v-laval/ https://www.ldc.fr/nous-connaitre/#nos-implantations - - - - - +# @author Jérémy +# https://wordpress.org/support/article/hardening-wordpress/ +# Block the include-only files. + +RewriteEngine On +RewriteBase / +RewriteRule ^wp-admin/includes/ - [F,L] +RewriteRule !^wp-includes/ - [S=3] +RewriteRule ^wp-includes/[^/]+\.php$ - [F,L] +RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L] +RewriteRule ^wp-includes/theme-compat/ - [F,L] + # BEGIN WordPress # Les directives (lignes) entre 'BEGIN WordPress' et 'END WordPress' sont