<ifModule mod_headers.c>
# YEAR
<filesMatch ".(ico|gif|jpg|jpeg|png|flv|pdf)$">
Header set Cache-Control "max-age=29030400"
</filesMatch>
# WEEK
<filesMatch ".(js|css|swf)$">
Header set Cache-Control "max-age=604800"
</filesMatch>
# 45 MIN
<filesMatch ".(html|htm|txt|php)$">
Header set Cache-Control "max-age=2700"
</filesMatch>
</ifModule>
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
<ifmodule mod_deflate.c>
#AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/x-javascript application/javascript
#AddHandler application/x-httpd-php56 .php
</ifmodule>
<IfModule mod_rewrite.c>

RewriteEngine on
#RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
#RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/sw/$1 [R=301,L]
Options -Indexes +FollowSymLinks -MultiViews


#maintenance links
RewriteRule ^maintenance_edit/([^/]*)$ maintenance.php?id=$1 [L]
RewriteRule ^calibration_add/([^/]*)$ calibration_add.php?id=$1 [L]
RewriteRule ^calibration_edit/([^/]*)$ calibration_add.php?id=$1 [L]
RewriteRule ^calibration_tracking/([^/]*)$ calibration_tracking.php?id=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
</ifModule>