# ==================================================
# SH SPORTS INNOVATIONS
# CRICKET DIRECTORY SECURITY
# ==================================================

# Disable directory listing
Options -Indexes

# Disable content negotiation
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

# Block sensitive files
<FilesMatch "(?i)(^\.|\.env$|\.ini$|\.log$|\.bak$|\.backup$|\.old$|\.sql$|\.sqlite$|\.db$|\.conf$|\.config$|\.yml$|\.yaml$|\.lock$)">
    Require all denied
</FilesMatch>

# Block access to cache directory
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule (^|/)cricket_cache_v3(/|$) - [F,L,NC]
</IfModule>

# Prevent browsers from caching API responses
<IfModule mod_headers.c>
    <FilesMatch "\.php$">
        Header always set Cache-Control "private, no-store, no-cache, must-revalidate"
        Header always set Pragma "no-cache"
        Header always set Expires "0"
    </FilesMatch>
</IfModule>

# ==================================================
# END CRICKET SECURITY
# ==================================================