RewriteEngine On
RewriteBase /digital_pos/

# Rewrite URL without .php extension
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^([^/]+)/?$ $1.php [L]

# Block direct access to includes folder
RewriteRule ^includes/ - [F,L]

# Disable directory browsing
Options -Indexes
RewriteEngine On
RewriteBase /digital_pos/

# ===============================
# Clean URLs for accountant reports
# ===============================

# Redirect /reports to accountant_reports.php
RewriteRule ^reports/?$ pages/accountant/accountant_reports.php [L]

# Redirect /reports/income to income_statement.php
RewriteRule ^reports/income/?$ pages/accountant/income_statement.php [L]

# Redirect /reports/vat-collection to vat_collection_report.php
RewriteRule ^reports/vat-collection/?$ pages/accountant/vat_collection_report.php [L]

# Redirect /reports/payment-method to payment_method_report.php
RewriteRule ^reports/payment-method/?$ pages/accountant/payment_method_report.php [L]

# ... add more as needed ...

# ===============================
# Generic Rule: Strip .php extensions
# ===============================
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^([^/]+)/?$ $1.php [L]

# ===============================
# Block direct access to includes
# ===============================
RewriteRule ^includes/ - [F,L]

# Disable directory listing
Options -Indexes
