# ============================================================
# Stile LPG — root .htaccess
# Place the lpg-app-2 folder inside XAMPP htdocs, e.g.
#   C:\xampp\htdocs\stile-lpg\
# Then access the site at  http://localhost/stile-lpg/
# ============================================================

Options -Indexes
DirectoryIndex index.php

# Allow CORS for the backend API (mobile app)
<IfModule mod_headers.c>
    Header always set Access-Control-Allow-Origin "*"
    Header always set Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"
    Header always set Access-Control-Allow-Headers "Content-Type, Authorization"
</IfModule>

# Handle OPTIONS pre-flight
RewriteEngine On
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule .* - [R=200,L]

# Compatibility: if app is deployed at domain root, still honor
# hardcoded /stile-lpg/... links by internally rewriting them.
RewriteRule ^stile-lpg/(.*)$ $1 [L,NC,QSA]
