# PHP Values
php_value upload_max_filesize 100M
php_value post_max_size 100M
php_value memory_limit 512M

RewriteEngine On
RewriteBase /gerabah/admin/

# Redirect Trailing Slashes
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Rewrite "www.example.com -> example.com"
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

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

# Rewrite all other URLs to index.php
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

# Disable directory browsing
Options -Indexes

# Prevent file injection
<FilesMatch "\.(htaccess|htpasswd|ini|log|sh|inc|bak|sql)$">
    Order Allow,Deny
    Deny from all
</FilesMatch>
