# -------------------------------------------------------
# 1) Redirect root domain → /en
# -------------------------------------------------------
RewriteEngine On

# -------------------------------------------------------
# 2) Remove trailing slash for non-directories (optional)
# -------------------------------------------------------
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [R=301,L]

# -------------------------------------------------------
# 3) Rewrite all traffic into /public (Laravel-friendly)
# -------------------------------------------------------
RewriteCond %{REQUEST_URI} !^/public/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ public/$1 [L]

# -------------------------------------------------------
# 4) cPanel PHP Handler (leave untouched)
# -------------------------------------------------------
RewriteCond %{HTTP_HOST} ^W3ciphering\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.W3ciphering\.com$
RewriteRule ^/?$ "https\:\/\/www\.W3ciphering\.com\/en" [R=301,L]

# 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
