# Options -Indexes -MultiViews
# DirectoryIndex index.php
 
# <IfModule mod_rewrite.c>
#     RewriteEngine On
#     RewriteBase /etifci/
 
#     # Prevent direct access to /public in URL
#     RewriteCond %{THE_REQUEST} /public/ [NC]
#     RewriteRule ^public/(.*)$ /etifci/$1 [R=301,L]
 
#     # Route everything to /public internally
#     RewriteCond %{REQUEST_FILENAME} !-f
#     RewriteCond %{REQUEST_FILENAME} !-d
#     RewriteRule ^(.*)$ public/index.php [L]
# </IfModule>

Options -Indexes -MultiViews
DirectoryIndex index.php

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /etifci/

    # Redirect base URL to default language
    RewriteRule ^$ en [R=301,L]

    # Allow existing files/directories
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]

    # Route everything to CI4
    RewriteRule ^ public/index.php [L]
</IfModule>

