#AddHandler application/x-httpd-php .html .htm
<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>
      <IfModule mod_setenvif.c>
            BrowserMatch ^Mozilla/4 gzip-only-text/html
            BrowserMatch ^Mozilla/4\.0[678] no-gzip
            BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
            BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
      </IfModule>
      <IfModule mod_headers.c>
            Header append Vary User-Agent env=!dont-vary
      </IfModule>
AddOutputFilterByType DEFLATE text/css application/x-javascript text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon
</IfModule>

<ifModule mod_rewrite.c>
	RewriteEngine On
	RewriteBase /
    #RewriteRule ^index.html$ index.php [L]
	RewriteRule ^.*js/libs/(.*)\.[0-9]+\.js$ /WebClient/js/libs/$1.js [L]
	RewriteRule ^.*js/(.*)\.[0-9]+\.js$ /WebClient/js/$1.js [L]
	RewriteRule ^r.*/.*js/(.*).js$ /WebClient/js/$1.js [L]
	RewriteRule ^r.*/.*js/(.*).html$ /WebClient/js/$1.html [L]
	RewriteRule ^.*css/(.*)\.[0-9]+\.css$ /WebClient/css/$1.css [L]
	RewriteRule ^r.*/.*css/(.*).gif$ /WebClient/css/$1.gif [L]
	#RewriteRule ^/Resources/img/(.*)\.[0-9]+\.png$ /WebClient/Resources/img/$1.png [L]
	#RewriteRule ^/Resources/img/(.*)\.[0-9]+\.gif$ /WebClient/Resources/img/$1.gif [L]
	#RewriteRule ^/Resources/icons/(.*)\.[0-9]+\.png$ /WebClient/Resources/icons/$1.png [L]
	RewriteRule ^r(.*)/$ /WebClient/index.php?ricetta=$1 [L]
</ifModule>

<ifModule mod_headers.c>
	# Turn on Expires and set default expires to 3 days
	ExpiresActive On
	ExpiresDefault A2678400
 
	# Set up caching on media files for 1 month
	<filesMatch ".(ico|gif|jpg|jpeg|png|flv|pdf|swf|mov|mp3|wmv|ppt)$">
		ExpiresDefault A2678400
		Header append Cache-Control "public"
	</filesMatch>
 	
	# Set up 24 Hour caching on commonly updated files
	<filesMatch "^(main).(xml|txt|html|js|css)$">
		ExpiresDefault A2678400
		Header append Cache-Control "public, must-revalidate"
	</filesMatch>
 
	# Force no caching for dynamic files
	<filesMatch ".(php|cgi|pl|htm)$">
		ExpiresDefault A0
		Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0"
		Header set Pragma "no-cache"
	</filesMatch>
</ifModule>