<VirtualHost _default_:80>
    ServerName api.pos.local
    ServerAdmin admin@ikiwae.local
    
    DocumentRoot "/Users/grafihouse/Documents/Projects/Www/ikiwae/api/web"
    
    <Directory "/Users/grafihouse/Documents/Projects/Www/ikiwae/api/web">
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
        
        # Yii2 pretty URL support
        RewriteEngine on
        # If a directory or a file exists, use the request directly
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        # Otherwise forward the request to index.php
        RewriteRule . index.php
    </Directory>
    
    # Prevent access to hidden files and directories
    <DirectoryMatch "/\.">
        Require all denied
    </DirectoryMatch>
    
    # PHP settings
    php_value upload_max_filesize 128M
    php_value post_max_size 128M
    php_value memory_limit 256M
    php_value max_execution_time 300
    
    # Logging
    ErrorLog "/Users/grafihouse/Documents/Projects/Www/ikiwae/backend/runtime/logs/api-error.log"
    CustomLog "/Users/grafihouse/Documents/Projects/Www/ikiwae/backend/runtime/logs/api-access.log" combined

</VirtualHost>
