# Cricdesk — .htaccess
# Fix 403 Forbidden on LiteSpeed/Apache cPanel hosting

# Allow access to all files in this directory
Options -Indexes
Options +FollowSymLinks

# Allow PHP files to execute
<FilesMatch "\.php$">
    Order Allow,Deny
    Allow from all
</FilesMatch>

# Allow HTML files
<FilesMatch "\.(html|htm)$">
    Order Allow,Deny
    Allow from all
</FilesMatch>

# Allow JSON data files (created by sync.php)
<FilesMatch "\.json$">
    Order Allow,Deny
    Allow from all
</FilesMatch>

# CORS headers — needed for OBS Browser Source
<IfModule mod_headers.c>
    Header always set Access-Control-Allow-Origin "*"
    Header always set Access-Control-Allow-Methods "GET, POST, OPTIONS"
    Header always set Access-Control-Allow-Headers "Content-Type"
</IfModule>

# LiteSpeed specific — allow PHP execution
<IfModule LiteSpeed>
    RewriteEngine On
</IfModule>

# No cache for sync.php responses
<FilesMatch "sync\.php$">
    Header set Cache-Control "no-cache, no-store, must-revalidate"
    Header set Pragma "no-cache"
    Header set Expires "0"
</FilesMatch>
