# Enable Rewrite Engine
RewriteEngine On

# Set base directory
RewriteBase /barber/

# Prevent access to hidden files
<FilesMatch "^\.">
    Order allow,deny
    Deny from all
</FilesMatch>

# Prevent directory browsing
Options -Indexes

# Route all requests to index.php except existing files/directories
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]

# Default document
DirectoryIndex index.php

# PHP settings (optional)
<IfModule mod_php7.c>
    php_value upload_max_filesize 5M
    php_value post_max_size 6M
    php_value max_execution_time 300
    php_value max_input_time 300
</IfModule>
