<IfModule mod_rewrite.c>
    RewriteEngine On
    Options -Indexes

    # Block direct access to hidden files and sensitive directories
    RewriteRule (^|/)\.(?!well-known/) - [F]
    RewriteRule ^(app|bootstrap|config|database|resources|routes|storage|tests|vendor|artisan|composer\.(json|lock)|package\.json) - [F,L]

    # Rewrite all traffic into the /public directory
    RewriteCond %{REQUEST_URI} !^/public/
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

# Fallback DirectoryIndex
DirectoryIndex public/index.php index.php

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php83” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php83 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
