Options -Indexes
ServerSignature Off
RewriteEngine On

# secure htaccess file - file should be CHMOD to 644 as first line of defense
<Files .htaccess>
 order allow,deny
 deny from all
</Files>


# EXPIRATIONS OF RESOURCES
<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On 
# Default directive
ExpiresDefault "access plus 1 month"
# My favicon
ExpiresByType image/x-icon "access plus 1 year"
# Images
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
# CSS
ExpiresByType text/css "access plus 1 month"
# Javascript
ExpiresByType application/javascript "access plus 1 year"
</IfModule>

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#API 
RewriteRule api api.php [L]
#DASH ELEMENTS URIS
#https://sagecorelocal.com/specthomes/dash/upcomingInspections
RewriteRule ^dash/(.*) index.php/dash?element=$1 [NC]

#MAIN REWRITE
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php [L,QSA]
