RewriteEngine On
RewriteBase /ebay/

# Static files seedha serve karo (CSS, JS, images)
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ - [L]

RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

# Pretty URLs → index.php pe forward karo
# e.g. auth/login → index.php?controller=auth&action=login
RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)/?$ index.php?controller=$1&action=$2 [QSA,L]

# Sirf controller → index.php?controller=...
RewriteRule ^([a-zA-Z0-9_-]+)/?$ index.php?controller=$1 [QSA,L]

# Protect sensitive directories
RedirectMatch 403 ^/ebay/config/.*$
RedirectMatch 403 ^/ebay/logs/.*$

# Block access to sensitive files
<FilesMatch "\.(env|log|ini|sql)$">
    Order allow,deny
    Deny from all
</FilesMatch>

Options -Indexes
