51 lines
1.2 KiB
ApacheConf
51 lines
1.2 KiB
ApacheConf
# Wyłącz listowanie
|
|
Options -Indexes
|
|
|
|
# Zezwol na wykonywanie PHP tylko dla legacy filemanagera
|
|
SetEnvIf Request_URI "^/libraries/filemanager-9\.14\.[12]/.*\.(php|phtml|php[0-9]?|phar|pht)$" allow_legacy_filemanager_php=1
|
|
|
|
# Domyślnie blokujemy wszystko…
|
|
Require all denied
|
|
|
|
# …a dopiero potem pozwalamy na pliki statyczne
|
|
<FilesMatch "\.(css|js|map|mjs|png|jpe?g|gif|svgz?|webp|ico|woff2?|woff|ttf|eot)$">
|
|
Require all granted
|
|
</FilesMatch>
|
|
|
|
# Twardo blokuj cokolwiek, co mogłoby się wykonać
|
|
<FilesMatch "\.(php|phtml|php[0-9]?|phar|pht|cgi|pl|py|sh)$">
|
|
<RequireAny>
|
|
Require env allow_legacy_filemanager_php
|
|
Require all denied
|
|
</RequireAny>
|
|
</FilesMatch>
|
|
|
|
<Files "thumb.php">
|
|
Require all granted
|
|
</Files>
|
|
|
|
<Files "ajax.php">
|
|
Require all granted
|
|
</Files>
|
|
|
|
<Files "upload-product-images.php">
|
|
Require all granted
|
|
</Files>
|
|
|
|
<Files "upload-product-files.php">
|
|
Require all granted
|
|
</Files>
|
|
|
|
<Files "upload-articles-files.php">
|
|
Require all granted
|
|
</Files>
|
|
|
|
<Files "upload-articles-images.php">
|
|
Require all granted
|
|
</Files>
|
|
|
|
# Nie serwuj plików ukrytych (.env itp.)
|
|
<FilesMatch "^\.(.*)$">
|
|
Require all denied
|
|
</FilesMatch>
|