Options -Indexes -MultiViews

RewriteEngine On

# Authorization header
SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

# =========================================================
# VEERGAME SAAS API
#
# Frontend requests:
# /api-live-v4/api/Lottery/GetUserInfo
# /api-live-v4/api/Lottery/GetGameInfo
# /api-live-v4/api/Lottery/GetGameList
# /api-live-v4/api/Lottery/GetBalance
#
# Send them to:
# Lottery/index.php?action=...
# =========================================================

RewriteRule ^api/Lottery/([A-Za-z0-9_-]+)/?$ Lottery/index.php?action=$1 [QSA,L]

# Also support the version without /api
RewriteRule ^Lottery/([A-Za-z0-9_-]+)/?$ Lottery/index.php?action=$1 [QSA,L]

# =========================================================
# CACHE CONTROL
# =========================================================

<IfModule mod_headers.c>
    Header always set Cache-Control "no-cache, no-store, must-revalidate, max-age=0"
    Header always set Pragma "no-cache"
    Header always set Expires "0"
</IfModule>

# =========================================================
# BLOCK SENSITIVE FILES
# =========================================================

<FilesMatch "\.(sql|ini|log|bak|env)$">
    Require all denied
</FilesMatch>

<FilesMatch "^\.">
    Require all denied
</FilesMatch>