# ═══ DIRECTORY LISTING বন্ধ (LiteSpeed-এর জন্য IfModule ছাড়া) ═══
Options -Indexes -MultiViews
DirectoryIndex index.php index.html

<IfModule mod_rewrite.c>
    RewriteEngine On

    # public ফোল্ডারের অ্যাসেট ম্যাপিং
    RewriteRule ^(uploads|frontEnd|backEnd)/(.*)$ public/$1/$2 [L]

    # Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Trailing Slash রিডাইরেক্ট
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # সংবেদনশীল ফোল্ডার ব্লক
    RewriteRule ^storage/logs/ - [F,L]
    RewriteRule ^storage/framework/ - [F,L]
    RewriteRule ^vendor/ - [F,L]
    RewriteRule ^\.git/ - [F,L]

    # Front Controller
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

# ═══ SECURITY: সংবেদনশীল ফাইল ব্লক ═══
<FilesMatch "^(\.env|\.env\.example|composer\.json|composer\.lock|package\.json|package-lock\.json|artisan|phpunit\.xml|vite\.config\.js|webpack\.mix\.js|sail|\.gitignore|error_log)$">
    Require all denied
</FilesMatch>

# ব্যাকআপ ও আর্কাইভ ফাইল ব্লক
<FilesMatch "\.(zip|tar|gz|sql|bak|log|ini)$">
    Require all denied
</FilesMatch>

# ═══ SECURITY HEADERS ═══
<IfModule mod_headers.c>
    Header set X-Frame-Options "SAMEORIGIN"
    Header set X-Content-Type-Options "nosniff"
    Header set Referrer-Policy "strict-origin-when-cross-origin"
    Header set Strict-Transport-Security "max-age=31536000; includeSubDomains"
</IfModule>

# ═══ SPEED: GZIP COMPRESSION ═══
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript
    AddOutputFilterByType DEFLATE application/javascript application/x-javascript application/json
    AddOutputFilterByType DEFLATE application/xml application/rss+xml font/ttf font/otf image/svg+xml
</IfModule>

# ═══ SPEED: BROWSER CACHING ═══
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpeg "access plus 1 year"
    ExpiresByType image/png "access plus 1 year"
    ExpiresByType image/webp "access plus 1 year"
    ExpiresByType image/gif "access plus 1 year"
    ExpiresByType image/svg+xml "access plus 1 year"
    ExpiresByType image/x-icon "access plus 1 year"
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType application/javascript "access plus 1 month"
    ExpiresByType font/ttf "access plus 1 year"
    ExpiresByType font/otf "access plus 1 year"
    ExpiresByType font/woff "access plus 1 year"
    ExpiresByType font/woff2 "access plus 1 year"
</IfModule>

# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
<IfModule php8_module>
   php_flag display_errors Off
   php_value max_execution_time 3000
   php_value max_input_time 3000
   php_value max_input_vars 3000
   php_value memory_limit 1024M
   php_value post_max_size 100M
   php_value session.gc_maxlifetime 3000
   php_value session.save_path "/var/cpanel/php/sessions/ea-php82"
   php_value upload_max_filesize 100M
   php_flag zlib.output_compression On
</IfModule>
<IfModule lsapi_module>
   php_flag display_errors Off
   php_value max_execution_time 3000
   php_value max_input_time 3000
   php_value max_input_vars 3000
   php_value memory_limit 1024M
   php_value post_max_size 100M
   php_value session.gc_maxlifetime 3000
   php_value session.save_path "/var/cpanel/php/sessions/ea-php82"
   php_value upload_max_filesize 100M
   php_flag zlib.output_compression On
</IfModule>
# END cPanel-generated php ini directives, do not edit

# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
<IfModule php8_module>
   php_flag display_errors On
   php_value max_execution_time 3000
   php_value max_input_time 3000
   php_value max_input_vars 3000
   php_value memory_limit 1024M
   php_value post_max_size 100M
   php_value session.gc_maxlifetime 3000
   php_value session.save_path "/var/cpanel/php/sessions/alt-php81"
   php_value upload_max_filesize 100M
   php_flag zlib.output_compression On
</IfModule>
<IfModule lsapi_module>
   php_flag display_errors On
   php_value max_execution_time 3000
   php_value max_input_time 3000
   php_value max_input_vars 3000
   php_value memory_limit 1024M
   php_value post_max_size 100M
   php_value session.gc_maxlifetime 3000
   php_value session.save_path "/var/cpanel/php/sessions/alt-php81"
   php_value upload_max_filesize 100M
   php_flag zlib.output_compression On
</IfModule>
# END cPanel-generated php ini directives, do not edit

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