DirectoryIndex index.php

<IfModule mod_php5.c>
      Define PHP_MODULE_INSTALLED
</IfModule>

<IfModule mod_php7.c>
      Define PHP_MODULE_INSTALLED
</IfModule>

<IfDefine PHP_MODULE_INSTALLED>
    php_value max_input_time 120
    php_value session.gc_maxlifetime 86400
    php_value memory_limit 128M
    php_value upload_max_filesize 20M
    php_value post_max_size 20M
    php_value safe_mode off
    php_flag display_errors off
    php_flag log_errors on
    php_flag magic_quotes_gpc off
    php_flag magic_quotes_runtime off
    php_flag register_globals off
    php_value max_execution_time 90
</IfDefine>

<IfModule mod_rewrite.c>
    RewriteEngine on

    # ActiveSync
    RewriteRule ^Microsoft-Server-ActiveSync index.php?frontend=activesync         [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
    
    # OpenID
    RewriteRule ^users/(.*)                  index.php?frontend=openid&username=$1 [L,QSA]

    # WebDAV / CalDAV / CardDAV
    RewriteCond %{REQUEST_METHOD} !^(GET|POST)$
    RewriteRule ^$                           index.php?frontend=webdav             [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]

    RewriteRule ^addressbooks                index.php?frontend=webdav             [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
    RewriteRule ^calendars                   index.php?frontend=webdav             [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
    RewriteRule ^webdav                      index.php?frontend=webdav             [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
    RewriteRule ^principals                  index.php?frontend=webdav             [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
    RewriteRule ^remote.php                  index.php?frontend=webdav             [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
    
    # Anonymous downloads
    RewriteRule ^download/get/(.*)           index.php?method=Download.downloadNode&path=$1 [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
    RewriteRule ^download/show/(.*)          index.php?method=Download.displayNode&path=$1  [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]

    # Routing
    <Location />
        RewriteCond %{REQUEST_FILENAME} -s [OR]
        RewriteCond %{REQUEST_FILENAME} -l [OR]
        RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule ^.*$ - [NC,L]
        RewriteRule ^.*$ index.php?doRouting=1 [E=REMOTE_USER:%{HTTP:Authorization},L,QSA]
     </Location>
</IfModule>

<IfModule mod_expires.c>
    ExpiresActive on

    ExpiresByType image/gif "access plus 1 month 1 days"
    ExpiresByType image/jpeg "access plus 1 month 1 days"
    ExpiresByType image/png "access plus 1 month 1 days" 
</IfModule>
