# ============================================
# EcomCloser AI - .htaccess Additions
# Version: 1.0.3
# ============================================

# INSTRUCTIONS:
# 1. Open your .htaccess file in site root
# 2. Find the line: # END WordPress
# 3. Add these lines BEFORE # END WordPress
# 4. Save file

# ============================================
# Allow file uploads (fixes 403 error)
# ============================================

<IfModule mod_security.c>
  <LocationMatch "/wp-json/apais/v1/upload">
    SecRuleEngine Off
  </LocationMatch>
</IfModule>

# ============================================
# Optional: Increase upload limits
# ============================================

# Uncomment these if you need larger uploads:
# php_value upload_max_filesize 10M
# php_value post_max_size 10M
# php_value memory_limit 256M
# php_value max_execution_time 300

# ============================================
# Alternative: Disable specific ModSec rules
# ============================================

# If LocationMatch doesn't work, try disabling specific rules:
# <IfModule mod_security.c>
#   SecRuleRemoveById 960335
#   SecRuleRemoveById 950005
#   SecRuleRemoveById 950006
# </IfModule>

# ============================================
# IMPORTANT NOTES:
# ============================================

# 1. If you're using Cloudflare, also add WAF exception:
#    - Go to: Cloudflare → Security → WAF
#    - Create rule: Skip for /wp-json/apais/v1/upload

# 2. If using Hostinger:
#    - May need to contact support to whitelist endpoint
#    - See HOSTINGER-WAF-FIX.md for details

# 3. Test after adding:
#    - Upload test file via chat
#    - Check browser console for errors
#    - If still 403, check server error logs

# ============================================
# END OF ADDITIONS
# ============================================