# IMPORTANT: DO NOT EDIT THIS FILE!
# It will be overwritten with any future upgrade.

<IfModule authz_core_module>
    Require all granted
</IfModule>
<IfModule !authz_core_module>
    Allow from all
</IfModule>

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteRule .* - [env=REDIRECT_HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    # Catch everything ending exactly in rpc.php
    RewriteRule ^rpc\.php$ horde/rpc.php [QSA,L]
    # Catch all rewrites under rpc.php
    RewriteRule ^rpc\.php(.*)$ horde/rpc.php/$1 [QSA,L]
    # Catch everything in the /rpc/ dir
    RewriteRule ^rpc/(.*)$ horde/rpc.php/$1 [QSA,L]
    ## Catch /rpc without trailing slash but not /rpcsomething
    RewriteRule ^rpc$ horde/rpc.php/ [QSA,L]

    ## Forward from traditional login location to subdir
    RewriteCond   login.php  !-d
    RewriteCond   login.php  !-f
    RewriteRule login.php(.*)$ horde/login.php$1 [QSA,L]

    ## Forward remaining requests to rampage controller framework
    RewriteRule ^rpc$ horde/rpc.php/ [QSA,L]
    RewriteCond   %{REQUEST_FILENAME}  !-d
    RewriteCond   %{REQUEST_FILENAME}  !-f
    RewriteRule ^(.*)$ horde/rampage.php [QSA,L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{DOCUMENT_ROOT}/$1/index.php !-f
    RewriteRule ^(.*?)/?$ horde/rampage.php [L]

</IfModule>

