# EVLA Contract Generator - Apache Configuration

# Protect generated contracts directory
<IfModule mod_rewrite.c>
    RewriteEngine On
    
    # Block direct access to generated_contracts
    RewriteRule ^generated_contracts/.*$ - [F,L]
    
    # Block direct access to vendor directory
    RewriteRule ^vendor/.*$ - [F,L]
    
    # Block direct access to includes directory
    RewriteRule ^includes/.*$ - [F,L]
</IfModule>

# Prevent directory listing
Options -Indexes

# Protect config file
<Files "config.php">
    Order Allow,Deny
    Deny from all
</Files>

# Protect init file
<Files "init.php">
    Order Allow,Deny
    Deny from all
</Files>

# Protect SQL files
<FilesMatch "\.(sql)$">
    Order Allow,Deny
    Deny from all
</FilesMatch>

# Enable error pages (customize as needed)
# ErrorDocument 404 /404.php
# ErrorDocument 500 /500.php

# Set PHP configuration (if allowed)
<IfModule mod_php7.c>
    php_value upload_max_filesize 10M
    php_value post_max_size 10M
    php_value max_execution_time 300
    php_value memory_limit 256M
</IfModule>
