# Rustic Safari — PHP hosting (no Node.js required)
# Works on standard cPanel Apache + PHP

Options -Indexes
RewriteEngine On

# Force HTTPS if available (optional — comment out if SSL not ready)
# RewriteCond %{HTTPS} !=on
# RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Route all /api/* requests to PHP API
RewriteRule ^api(?:/.*)?$ api/index.php [QSA,L]

# Serve admin panel
RewriteRule ^admin/?$ admin/index.html [L]

# Existing files/folders are served normally (html, css, js, images, videos)
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
