# Enable rewrite engine and route requests to framework
RewriteEngine On

# Some servers require you to specify the `RewriteBase` directive
# In such cases, it should be the path (relative to the document root)
# containing this .htaccess file
#
#RewriteBase /app/

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^(lib|tmp)\/|\.(ini|php)$ - [R=404]

RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L,QSA]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

# PHP global Vars
php_value max_input_vars 5000
php_value suhosin.get.max_vars 5000
php_value suhosin.post.max_vars 5000
php_value suhosin.request.max_vars 5000

# PHP error logs
php_flag log_errors on
# php_value error_log "/www/htdocs/w0128162/pathfinder.exodus4d.de/php_errors.html"

# cache images/pdf docs
<ifmodule mod_expires.c>
    # fonts
    <Filesmatch "\.(eot|woff2|woff|ttf)$">
        ExpiresActive on
        ExpiresDefault "access plus 1 year"
        Header append Cache-Control "public"
    </Filesmatch>

    # images/vector graphics
    <Filesmatch "\.(jpg|jpeg|png|gif|swf|ico|svg)$">
        ExpiresActive on
        ExpiresDefault "access plus 1 year"
        Header append Cache-Control "public"
        FileETag None
        Header unset ETag
    </Filesmatch>

    # js/css/source maps
    <Filesmatch "\.(js|css|map)$">
        ExpiresActive on
        ExpiresDefault "access plus 1 month"
    </Filesmatch>

    # html templates
    <Filesmatch "\.(htm|html)$">
        ExpiresActive on
        ExpiresDefault "access plus 1 week"
    </Filesmatch>
</ifmodule>
