# This file exists as a safeguard in case the CyberPanel vHost document root
# was accidentally pointed at the project root instead of the /public folder.
# Correct deployment: set the vHost / website "Document Root" to the
# /public subfolder directly. See DEPLOYMENT.md.

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_URI} !^/public/
    RewriteRule ^(.*)$ /public/$1 [L]
</IfModule>

# Deny access to sensitive files if this root is ever web-accessible
<FilesMatch "\.(env|sql|log|md|json|lock)$">
    Require all denied
</FilesMatch>

Options -Indexes
