#
# php-fpm can use .user.ini instead of .htaccess
#
<Files ".user.ini">
    Require all denied
</Files>
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteOptions AllowAnyURI

    #
    # Authorization header for JWT backend
    #
    SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0

    #
    # Don't rewrite if dir/link/file exists
    #
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule .* - [L]

    #
    # Handle in route class...
    #
    RewriteCond %{HTTPS} off
    RewriteRule .* - [E=REQUEST_SCHEME:http]

    RewriteCond %{HTTPS} on
    RewriteRule .* - [E=REQUEST_SCHEME:https]

    RewriteRule ^/?(.*)$ /index.php?request=- [L,QSA]
</IfModule>