# 1. Security: Disable directory listing to hide files
Options -Indexes

# 2. Security: Disable ETag for performance/security
<IfModule mod_headers.c>
    Header unset ETag
</IfModule>
FileETag None

# 3. Force HTTPS
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# 4. Redirect all traffic to the public/ folder
<IfModule mod_rewrite.c>
    RewriteEngine On
    
    # If the request is not already for the public folder, redirect it
    RewriteCond %{REQUEST_URI} !^/public/
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

# 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
