# Place this file as `.htaccess` in the subdomain DOCUMENT ROOT
# ONLY if document root cannot point to the Laravel `public/` folder.
#
# Layout on server:
#   /home/USER/test.grandvipbet.com/     ← document root (wrong but common)
#     .htaccess                          ← THIS FILE (rename from cpanel-root.htaccess)
#     app/
#     bootstrap/
#     config/
#     public/
#     ...
#     .env
#
# Prefer setting document root to .../public instead of using this shim.

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Block direct access to sensitive paths
    RewriteRule ^(app|bootstrap|config|database|resources|routes|storage|tests|vendor)/ - [F,L,NC]
    RewriteRule ^(\.env|\.env\..*|composer\.(json|lock)|artisan)$ - [F,L,NC]

    # Send everything into Laravel public/
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
