# ==========================================================================
# BLOOM IRIS AGENCY — URL REWRITING
# Removes index.php from URLs. Works on Apache (XAMPP) with mod_rewrite on.
# ==========================================================================
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /bloomiris/

    # Allow direct access to existing files and directories
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    # Route everything else through index.php
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    ErrorDocument 404 /index.php
</IfModule>

# Deny access to sensitive files
<FilesMatch "\.(sql|md|json|lock|ini)$">
    Require all denied
</FilesMatch>

# Protect the application & system directories
RewriteRule ^(application|system)/.* index.php [L]

# ==========================================================================
# PHP UPLOAD LIMITS (mod_php hosts only)
# Lets large hero / portfolio videos upload. On hosts running PHP as
# CGI/FastCGI/FPM these php_value lines are ignored (use .user.ini instead) —
# the <IfModule> guard prevents a 500 error in that case.
# ==========================================================================
<IfModule mod_php7.c>
    php_value upload_max_filesize 64M
    php_value post_max_size 68M
    php_value memory_limit 128M
    php_value max_execution_time 300
    php_value max_input_time 300
</IfModule>
<IfModule mod_php.c>
    php_value upload_max_filesize 64M
    php_value post_max_size 68M
    php_value memory_limit 128M
    php_value max_execution_time 300
    php_value max_input_time 300
</IfModule>
