# Laravel PUBLIC directory (.htaccess)

<IfModule mime_module>
  AddHandler application/x-httpd-ea-php81 .php .phtml
</IfModule>

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /

  # Disable directory listing and content negotiation
  <IfModule mod_negotiation.c>
    Options -MultiViews -Indexes
  </IfModule>
  Options +FollowSymLinks

  # Redirect trailing slashes if not a folder
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} (.+)/$
  RewriteRule ^ %1 [L,R=301]

  # Serve existing files and directories directly
  RewriteCond %{REQUEST_FILENAME} -f [OR]
  RewriteCond %{REQUEST_FILENAME} -d
  RewriteRule ^ - [L]

  # Route all other requests to index.php (Laravel front controller)
  RewriteRule ^ index.php [L]
</IfModule>
