RewriteEngine on
Options -Indexes
DirectoryIndex index.php
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

<IfModule mod_rewrite.c>
	RewriteEngine On
	RewriteRule ^index\.php$ - [L]
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule . index.php [L]
</IfModule>

<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access 1 year"
    ExpiresByType image/jpeg "access 1 year"
    ExpiresByType image/gif "access 1 year"
    ExpiresByType image/png "access 1 year"
    ExpiresByType text/css "access 1 month"
    ExpiresByType text/html "access 1 month"
    ExpiresByType application/pdf "access 1 month"
    ExpiresByType text/x-javascript "access 1 month"
    ExpiresByType application/x-shockwave-flash "access 1 month"
    ExpiresByType image/x-icon "access 1 year"
    ExpiresDefault "access 1 month"
</IfModule>
<ifModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/* text/html text/xml text/css text/plain text/x-component text/x-js text/richtext text/xsd text/xsl
    AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml image/x-icon
    AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml
    AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript application/json
    AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-otf
    AddOutputFilterByType DEFLATE font/truetype font/opentype
    Header append Vary User-Agent env=!dont-vary
    AddOutputFilter DEFLATE js css htm html xml text
</ifModule>

<FilesMatch ".(ico|pdf|flv)$">
    Header set Cache-Control "max-age=31536000, public"
</FilesMatch>

<FilesMatch ".(jpg|jpeg|png|gif|swf|webp)$">
    Header set Cache-Control "max-age=31536000, public"
</FilesMatch>

<FilesMatch ".(xml|txt|css|js)$">
    Header set Cache-Control "max-age=31536000, proxy-revalidate"
</FilesMatch>

<FilesMatch ".(html|htm|php)$">
    Header set Cache-Control "max-age=31536000, private, proxy-revalidate"
</FilesMatch>
