# ==========================================================================
# Morris Auto — root .htaccess for shared hosting (cPanel / Plesk)
#
# Use this ONLY if you upload the ENTIRE project into your public_html
# (or a subfolder) and cannot change the web root to the /public directory.
# It transparently forwards every request into the /public folder where
# Laravel's real front controller lives, WITHOUT exposing your source code.
#
# BEST PRACTICE: if your host lets you set the document root, point it at
# the "public" folder instead and delete this file.
# ==========================================================================

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Block direct access to sensitive files
    RewriteRule ^(\.env|\.git|composer\.(json|lock)|artisan|storage|bootstrap/cache) - [F,L]

    # Send everything into /public
    RewriteCond %{REQUEST_URI} !^/public/
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

# Deny access to hidden/dot files
<FilesMatch "^\.">
    Require all denied
</FilesMatch>
