Options +FollowSymLinks -Indexes -ExecCGI
DirectoryIndex index.php index.html
ServerSignature Off

RewriteEngine On

RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteRule ^(config|includes|vendor|logs)/ - [F,L]
RewriteRule ^(\.env|composer\.json|composer\.lock|\.git) - [F,L]

RewriteRule /\.(htaccess|htpasswd|ini|log|sh|sql)$ - [F,L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /index.php [L,QSA]

<IfModule mod_headers.c>
Header always unset X-Powered-By
Header set X-Frame-Options "SAMEORIGIN"
Header set X-Content-Type-Options "nosniff"
Header set X-XSS-Protection "1; mode=block"
</IfModule>

<FilesMatch "\.(env|ini|log|sql|conf)$">
Require all denied
</FilesMatch>

<LimitExcept GET POST>
Require all denied
</LimitExcept>

<Files ".htaccess">
Require all denied
</Files>