# CareRide — Apache / LiteSpeed (cPanel)
Options -Indexes
DirectoryIndex index.php
RewriteEngine On

# Force HTTPS (uncomment after SSL is active)
# RewriteCond %{HTTPS} !=on
# RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Block internals
RewriteRule ^(inc|sql|cron|backups)(/|$) - [F,L]
RewriteRule ^uploads/.*\.(php|phtml|phar|php\d)$ - [F,L]

# REST API
RewriteRule ^api/v1/(.*)$ api/index.php?r=$1 [QSA,L]

# Mobile app links (Android / iOS)
RewriteRule ^\.well-known/(assetlinks\.json|apple-app-site-association)$ site/index.php?path=.well-known/$1 [QSA,L]

# SEO files
RewriteRule ^sitemap\.xml$ site/sitemap.php [L]

# Marketing site pretty URLs
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ site/index.php?path=$1 [QSA,L]

<IfModule mod_headers.c>
  Header set X-Content-Type-Options "nosniff"
  <FilesMatch "\.(css|js|svg|png|jpg|jpeg|webp|woff2)$">
    Header set Cache-Control "public, max-age=2592000"
  </FilesMatch>
</IfModule>
<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/html text/css application/javascript application/json image/svg+xml text/plain application/xml
</IfModule>
