<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    # Disable PHP error display to prevent JSON corruption
    php_flag display_errors Off
    php_flag display_startup_errors Off
    php_value error_reporting 0

    # Set output buffering for clean JSON responses
    php_flag output_buffering On
    php_value output_buffering 4096

    RewriteEngine On

    # Handle Angular and Vue.js routes...
    # RewriteCond %{REQUEST_URI} ^/(.*).css$ [OR]
    # RewriteCond %{REQUEST_URI} ^/(.*).js$ [OR]
    # RewriteCond %{REQUEST_URI} ^/(.*).ico$ [OR]
    # RewriteCond %{REQUEST_URI} ^/(.*).png$ [OR]
    # RewriteCond %{REQUEST_URI} ^/(.*).jpg$ [OR]
    # RewriteCond %{REQUEST_URI} ^/(.*).gif$ [OR]
    # RewriteCond %{REQUEST_URI} ^/(.*).svg$
    # RewriteRule ^(.*)$ public/$1 [L]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Send Requests To Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>