Файловый менеджер - Редактировать - /home/gqdcvggs/.trash/.htaccess.3
Назад
# Activation du module de réécriture d'URL RewriteEngine On # Forcer HTTPS RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # Retirer le www RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^(.*)$ https://%1/$1 [R=301,L] # Retirer les extensions .php RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php [NC,L] # Bloquer l'accès aux fichiers sensibles <FilesMatch "^\."> Order allow,deny Deny from all </FilesMatch> # Protéger le fichier .env <Files .env> Order allow,deny Deny from all </Files> # Protéger le composer.json et composer.lock <FilesMatch "composer\.(json|lock)$"> Order allow,deny Deny from all </FilesMatch> # Désactiver l'affichage du contenu des répertoires Options -Indexes # Protection contre les injections XSS Header set X-XSS-Protection "1; mode=block" # Protection contre le clickjacking Header set X-Frame-Options "SAMEORIGIN" # Protection contre le MIME-Type sniffing Header set X-Content-Type-Options "nosniff" # Activer la protection CSRF Header set X-CSRF-Token "1" # Politique de sécurité du contenu (CSP) Header set Content-Security-Policy "default-src 'self' https: data: 'unsafe-inline' 'unsafe-eval'; img-src 'self' data: https:; font-src 'self' https: data:;" # Compression GZIP <IfModule mod_deflate.c> AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript application/xml </IfModule> # Mise en cache navigateur <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/jpg "access plus 1 year" ExpiresByType image/jpeg "access plus 1 year" ExpiresByType image/gif "access plus 1 year" ExpiresByType image/png "access plus 1 year" ExpiresByType image/svg+xml "access plus 1 year" ExpiresByType text/css "access plus 1 month" ExpiresByType application/javascript "access plus 1 month" </IfModule> # Protection contre les mauvais bots RewriteCond %{HTTP_USER_AGENT} ^$ [OR] RewriteCond %{HTTP_USER_AGENT} ^(java|curl|wget).* [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^.*(libwww-perl|wget|python|nikto|curl|scan|java|winhttp|clshttp|loader).* [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^[A-Z]{15,50}.* [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^.*(<|>|'|%0A|%0D|%27|%3C|%3E|%00).* [NC] RewriteRule .* - [F] # Rediriger les erreurs vers des pages personnalisées ErrorDocument 404 /404 ErrorDocument 403 /403 ErrorDocument 500 /500 # Règles pour les URLs propres RewriteRule ^accueil$ index.php [L] RewriteRule ^success$ success.php [L] RewriteRule ^cancel$ cancel.php [L] RewriteRule ^404$ 404.php [L] RewriteRule ^403$ 403.php [L] RewriteRule ^500$ 500.php [L] # Bloquer l'accès direct aux fichiers PHP dans certains dossiers RewriteRule ^includes/.*.php$ - [F,L] RewriteRule ^vendor/.*.php$ - [F,L] # Protection supplémentaire pour PHP php_value session.cookie_httponly 1 php_value session.cookie_secure 1 php_flag session.use_only_cookies on # Limiter la taille des téléchargements php_value upload_max_filesize 10M php_value post_max_size 10M
| ver. 1.6 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка