# CodeIgniter 3 - Apache/LiteSpeed rewrite rules
# Keep the application URL clean while sending application requests to index.php.

<IfModule mod_rewrite.c>
    RewriteEngine On

    # If the application is installed in a subdirectory, these rules still work
    # because Apache evaluates them relative to this directory.
    RewriteBase /

    # Never rewrite existing files or directories (assets, uploads, etc.).
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]

    # Send all other requests, including POST /auth/login, to CodeIgniter.
    RewriteRule ^ index.php [L]
</IfModule>

# Prevent Apache from exposing directory listings.
Options -Indexes

# Use index.php as the directory index.
DirectoryIndex index.php
