# ── Hide .php extension ───────────────────────────────────────────────────────
RewriteEngine On

# Redirect existing .php URLs to clean URLs
RewriteCond %{THE_REQUEST} \s/+lakshmi/([^.]+)\.php[\s?] [NC]
RewriteRule ^ /lakshmi/%1 [R=301,L]

# Serve clean URLs as .php files
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+)$ $1.php [L]

# ── Security ──────────────────────────────────────────────────────────────────
Options -Indexes

<FilesMatch "^(config|multi_company_helpers|role_helpers|email_helper|cpf_helper|license_helper)\.php$">
    Order allow,deny
    Deny from all
</FilesMatch>

# ── PHP settings ──────────────────────────────────────────────────────────────
php_flag display_errors Off
php_flag log_errors On
