<IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase /rezivo/

    # 1. Properly forward asset requests to the public directory (accounting for /rezivo/)
    RewriteCond %{REQUEST_URI} !^/rezivo/public/
    RewriteRule ^assets/(.*)$ public/assets/$1 [L]

    # 2. If the file or directory exists inside the public folder, serve it directly
    RewriteCond %{DOCUMENT_ROOT}/rezivo/public/$1 -f [OR]
    RewriteCond %{DOCUMENT_ROOT}/rezivo/public/$1 -d
    RewriteRule ^(.*)$ public/$1 [L]

    # 3. Otherwise, forward all other requests to the CodeIgniter front controller
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ public/index.php?/$1 [L]
</IfModule>
