# Add this to Apache .htaccess for API routing
# File: .htaccess

# Enable CORS
<IfModule mod_headers.c>
    Header set Access-Control-Allow-Origin "*"
    Header set Access-Control-Allow-Methods "GET, POST, DELETE, OPTIONS"
    Header set Access-Control-Allow-Headers "Content-Type, Authorization"
</IfModule>

# URL Rewriting (optional - API works without this)
<IfModule mod_rewrite.c>
    RewriteEngine On
    
    # Allow direct access to existing files
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule ^ - [L]
    
    # Route /api/* to api.php
    RewriteRule ^api/(.*)$ api.php/$1 [L,QSA]
</IfModule>

# Enable PHP error display (disable in production)
php_flag display_errors on
php_value error_reporting E_ALL

# Increase upload limits for attachments
php_value upload_max_filesize 10M
php_value post_max_size 10M
