<IfModule mod_rewrite.c>
 
    RewriteEngine On
    RewriteBase /
 
     RewriteCond %{REQUEST_URI} \.(jpg|jpeg|png|gif|webp|svg|bmp|ico)$ [NC]
    RewriteRule .* - [L]      

 
#HTTPS OFF
RewriteCond %{HTTPS} on 
RewriteRule ^(.*)$ http://%{HTTP_HOST}/scheduler/$1 [L,R=301]
# Force HTTP for everything except authenticate
#RewriteCond %{HTTPS} on
#RewriteCond %{REQUEST_URI} !^/scheduler/loginapi/authenticate$
#RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

#HTTPS ON
# RewriteCond %{HTTPS} off
# RewriteRule ^(.*)$ https://%{HTTP_HOST}/scheduler/$1 [L,R=301]
 
    ###
 
    # Removes access to the system folder by users.
    # Additionally this will allow you to create a System.php controller,
    # previously this would not have been possible.
    # 'system' can be replaced if you have renamed your system folder.
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)$ timesheet/index.php/$1 [L]
 
    # Checks to see if the user is attempting to access a valid file,
    # such as an image or css document, if this isn't true it sends the
    # request to index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$  scheduler/index.php/$1 [L]
 
</IfModule>
 
<IfModule !mod_rewrite.c>
 
    # Without mod_rewrite, route 404's to the front controller
    ErrorDocument 404 /index.php
 
</IfModule>

# NOTE: php_value directives removed - incompatible with PHP-FPM
# These settings are now in /etc/php/5.6/fpm/pool.d/scheduler.conf

# ENH-003: Gzip compression for text-based assets
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml
    AddOutputFilterByType DEFLATE text/css text/javascript
    AddOutputFilterByType DEFLATE application/javascript application/json
</IfModule>

# ENH-003: Browser cache headers for static assets
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/css "access plus 30 days"
    ExpiresByType application/javascript "access plus 30 days"
    ExpiresByType image/jpeg "access plus 30 days"
    ExpiresByType image/png "access plus 30 days"
    ExpiresByType image/gif "access plus 30 days"
    ExpiresByType image/webp "access plus 30 days"
</IfModule>
