<IfModule mod_rewrite.c>
    RewriteEngine On

    # Prevent directory listing
    Options -Indexes

    # Block access to hidden files and sensitive directories
    RewriteRule ^(\.env|\.git|\.gitignore|\.gitattributes|composer\.(json|lock)|storage/.*|vendor/.*) - [F,L]

    # Keep .well-known accessible via HTTP/HTTPS for renewals
    RewriteRule ^\.well-known/ - [L]

    # Force HTTPS for all other traffic
    RewriteCond %{HTTPS} off
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

    # Public redirection
    RewriteCond %{REQUEST_URI} !^/public/
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

# Aumentar limites para upload de vídeos grandes
php_value upload_max_filesize 500M
php_value post_max_size 510M
php_value max_execution_time 600
php_value memory_limit 512M
php_value max_input_time 600