# BEGIN Uploader
Options -Indexes

RewriteEngine On
RewriteRule ^site\.webmanifest$ site.webmanifest.php [L]
ErrorDocument 404 /uploader/404/index.php
ErrorDocument 403 /uploader/403/index.php

RewriteRule ^last\.php$ recent/ [R=301,L]
RewriteRule ^top\.php$ popular/ [R=301,L]
RewriteRule ^install\.php$ install/ [R=301,L]
RewriteRule ^backups(/|$) - [F,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !/(recent|popular|privacy|tos|dmca|install|manage|404|403)/?$
RewriteRule ^([a-zA-Z0-9]+)$ file-details.php?code=$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9]+)/dl$ file-details.php?code=$1&dl=true [L,QSA]

RewriteRule ^fileDetails\.php$ file-details.php [L,QSA]

<FilesMatch "^config(\.local)?\.php$">
    Require all denied
</FilesMatch>
<FilesMatch "\.(log|sql|bak|env)$">
    Require all denied
</FilesMatch>

<IfModule php_module>
    php_value upload_max_filesize 256M
    php_value post_max_size 256M
    php_value max_input_time 300
    php_value max_execution_time 300
</IfModule>
<IfModule mod_php.c>
    php_value upload_max_filesize 256M
    php_value post_max_size 256M
    php_value max_input_time 300
    php_value max_execution_time 300
</IfModule>

<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/css "access plus 7 days"
    ExpiresByType application/javascript "access plus 7 days"
    ExpiresByType image/png "access plus 30 days"
    ExpiresByType image/svg+xml "access plus 30 days"
    ExpiresByType image/x-icon "access plus 30 days"
    ExpiresByType font/woff2 "access plus 30 days"
</IfModule>
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/css application/javascript application/json application/manifest+json
</IfModule>

<IfModule mod_headers.c>
    Header always set X-Content-Type-Options nosniff
    Header always set X-Frame-Options DENY
    Header always set X-XSS-Protection "1; mode=block"
    Header always set Referrer-Policy "strict-origin-when-cross-origin"
    Header always set Permissions-Policy "camera=(), microphone=(), geolocation=()"
</IfModule>
# END Uploader
