<IfModule mod_rewrite.c>
  # Ensure index.php is used when requesting a directory
  DirectoryIndex index.php index.html
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

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

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

  # If the request targets the directory root (e.g. GET /ouvidoriast/public/)
  # rewrite it to index.php so Laravel receives the request instead of
  # Apache returning a 405 for the directory URL.
  RewriteCond %{REQUEST_URI} ^/.*(/public/)?$ [OR]
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^ index.php [L]
</IfModule>

# php -- BEGIN cPanel-generated handler, do not edit
# Defina o pacote “ea-php83” como a linguagem padrão de programação “PHP”.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php83 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit

## Development: prevent aggressive caching of built assets
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType text/css "access plus 0 seconds"
  ExpiresByType application/javascript "access plus 0 seconds"
  ExpiresByType application/x-javascript "access plus 0 seconds"
  ExpiresByType image/svg+xml "access plus 0 seconds"
</IfModule>

<IfModule mod_headers.c>
  <FilesMatch "build/assets/.*\.(css|js)$">
    Header set Cache-Control "no-cache, no-store, must-revalidate"
    Header set Pragma "no-cache"
    Header set Expires "0"
  </FilesMatch>
</IfModule>
