feat: move apache & nginx configuration examples in conf directory
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
RewriteEngine On
|
||||
|
||||
# ======================
|
||||
# SÉCURITÉ
|
||||
# ======================
|
||||
|
||||
# Bloquer l'accès aux fichiers de configuration
|
||||
<Files ~ "\.(php|inc|conf|config|local)$">
|
||||
Require all denied
|
||||
</Files>
|
||||
|
||||
# Protéger les répertoires sensibles
|
||||
RewriteRule ^(includes|cache|docs|conf)/ - [F,L]
|
||||
|
||||
# Bloquer les fichiers samples et backups
|
||||
<FilesMatch "\.(sample|bak|backup|log|tmp)$">
|
||||
Require all denied
|
||||
</FilesMatch>
|
||||
|
||||
# Empêcher l'exploration des répertoires
|
||||
Options -Indexes
|
||||
|
||||
# Bloquer l'accès aux fichiers cachés
|
||||
<FilesMatch "^\.">
|
||||
Require all denied
|
||||
</FilesMatch>
|
||||
|
||||
# ======================
|
||||
# RÉÉCRITURE D'URL
|
||||
# ======================
|
||||
|
||||
# Masquer l'extension .php
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^([^\.]+)$ $1.php [NC,L]
|
||||
|
||||
# Rediriger les URLs avec .php vers les URLs sans extension
|
||||
RewriteCond %{THE_REQUEST} /([^.]+)\.php [NC]
|
||||
RewriteRule ^ /%1 [NC,L,R=301]
|
||||
|
||||
# Pour accéder à page.php via /page
|
||||
RewriteCond %{REQUEST_FILENAME}.php -f
|
||||
RewriteRule ^([^/]+)$ $1.php [L]
|
||||
|
||||
# ======================
|
||||
# HTTPS
|
||||
# ======================
|
||||
|
||||
# Force HTTPS
|
||||
RewriteCond %{HTTP:X-Forwarded-Proto} !https
|
||||
RewriteCond %{HTTPS} !on
|
||||
RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
|
||||
Reference in New Issue
Block a user