.htaccess 1.24 KB
Newer Older
1 2
RewriteEngine on

Laurent's avatar
Laurent committed
3
RewriteCond %{REQUEST_URI} !^/(google[a-z0-9]+\.html|.*/xhprof_html|ckeditor|exploit|\.well-known)
4
RewriteCond %{REQUEST_FILENAME} !^.*/robots\.txt$ [NC]
5

6
RewriteRule !(userfiles|public|tmp|temp|skins|library/templates|library/digital_resources/.*/js)/.*\.(js|ico|txt|gif|jpg|jpeg|png|css|xml|swf|mov|pdf|doc|docx|woff|woff2|eot|svg|ttf|xls|xlsx|wsdl|mp3|m4v|ogg|ogv|epub|htm|html|xhtml|asmx|zip|sql|bro|flv|mp4|webm|tgz|json|geojson|xsl|ods|odp|odt|ots|ott|odm|odg|otg|otp)$ index.php [NC,NE]
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29

AddType application/x-javascript .js
AddType text/css .css
AddType application/json .json

<FilesMatch "\.(css|js)($|\?.*$)">
SetOutputFilter DEFLATE
Header add "Cache-Control" "max-age=604800, public"
</FilesMatch>

AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header add "Cache-Control" "max-age=604800, public"
</FilesMatch>