# <IfModule mod_rewrite.c>
#     Options +FollowSymLinks
#     RewriteEngine On

#     # Handle Authorization Header
#     RewriteCond %{HTTP:Authorization} .
#     RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

#     # Redirecionar arquivos estáticos para a pasta public
#     RewriteCond %{REQUEST_URI} \.(css|js|jpg|jpeg|png|gif|ico|woff|woff2|ttf|svg|eot)$ [NC]
#     RewriteRule ^(.*)$ public/$1 [L]

#     # Redirecionar se não for um arquivo ou diretório existente
#     RewriteCond %{REQUEST_FILENAME} !-d
#     RewriteCond %{REQUEST_FILENAME} !-f
#     RewriteCond %{REQUEST_URI} !^/public/
#     RewriteRule ^(.*)$ public/index.php [L,QSA]

#     # Permitir acesso a arquivos estáticos
#     <FilesMatch "\.(css|js|jpg|jpeg|png|gif|ico|woff|woff2|ttf|svg|eot)$">
#         Order Allow,Deny
#         Allow from all
#         Require all granted
#     </FilesMatch>
# </IfModule>

# # Desabilitar MultiViews para evitar conflitos
# <IfModule mod_negotiation.c>
#     Options -MultiViews
# </IfModule>



<IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirecionar arquivos estáticos para a pasta public
    RewriteCond %{REQUEST_URI} \.(css|js|jpg|jpeg|png|gif|ico|woff|woff2|ttf|svg|eot)$ [NC]
    RewriteRule ^(.*)$ public/$1 [L]

    # Redirecionar tudo que não for public para public/index.php
    RewriteCond %{REQUEST_URI} !^public
    RewriteRule ^(.*)$ public/index.php [L,QSA]

    # Permitir acesso a arquivos estáticos
    <FilesMatch "\.(css|js|jpg|jpeg|png|gif|ico|woff|woff2|ttf|svg|eot)$">
        Order Allow,Deny
        Allow from all
        Require all granted
    </FilesMatch>
</IfModule>

# Desabilitar MultiViews para evitar conflitos
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

# PHP Handlers
<IfModule mod_php8.c>
    php_value upload_max_filesize 64M
    php_value post_max_size 64M
    php_value max_execution_time 300
    php_value max_input_time 300
</IfModule>