# http://typo3.org/teams/security/security-bulletins/typo3-20080611-1/
ForceType text/plain
#Here we assume certain MSIE 6.0 agents are from linkscanner
#redirect these requests back to avg in the hope they'll see their silliness
#Rewritecond %{HTTP_USER_AGENT} ".*MSIE 6.0; Windows NT 5.1; SV1.$" [OR]
#Rewritecond %{HTTP_USER_AGENT} ".*MSIE 6.0; Windows NT 5.1;1813.$"
#RewriteCond %{HTTP_REFERER} ^$
#RewriteCond %{HTTP:Accept-Encoding} ^$
#RewriteRule ^.* http://typofree.org/avg-crawler-bucket/ [R=307,L]
# Attempt to fix realurl loop thingie because some crawlers do not respect
# the tag
# http://typo3bloke.net/post-details/archive/2008/may/26/check_your_404_traffic/
RewriteEngine On
RewriteCond %{REQUEST_URI} ^.+(/(fileadmin|uploads|typo3conf|typo3temp)/.*)
RewriteRule ^.*$ %1 [L,R=301]
#RewriteLog "/home/httpd/logs/rewrite.log"
#RewriteLogLevel 4
# Enable compression (reduce traffic by 70%)
# http://httpd.apache.org/docs/2.0/mod/mod_deflate.html
SetOutputFilter DEFLATE
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
# the above regex won't work. You can use the following
# workaround to get the desired effect:
BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
# Don't compress everything
SetEnvIfNoCase Request_URI \.(?i:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?i:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.avi$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.mov$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.mp3$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.mp4$ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.rm$ no-gzip dont-vary
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE text/css
# Send expiry headers for files that do not change often
# http://httpd.apache.org/docs/2.0/mod/mod_expires.html
ExpiresActive on
# Do not set default expires header because TYPO3 sends it's own headers, this
# may lead to duplicate headers!
# ExpiresDefault "access plus 48 hours 1 seconds"
ExpiresByType image/gif "access plus 48 hours 1 seconds"
ExpiresByType image/png "access plus 48 hours 1 seconds"
ExpiresByType text/css "access plus 48 hours 1 seconds"
ExpiresByType application/x-javascript "access plus 48 hours 1 seconds"
ExpiresByType application/javascript "access plus 48 hours 1 seconds"
ExpiresByType text/javascript "access plus 48 hours 1 seconds"
ExpiresByType image/jpeg "access plus 48 hours 1 seconds"
ExpiresByType application/x-shockwave-flash "access plus 48 hours 1 seconds"
# Do not cache the main php files in /typo3
ExpiresActive Off
# Make proper Etags
# http://httpd.apache.org/docs/2.0/mod/core.html#fileetag
# Header unset ETag
# FileETag none
FileETag MTime Size
# Disable Last-Modified headers
# Only enable if you are really serious about optimisation and can argue that
# it's just 'not feasible' for you to send a Last-Modified header . . . ;-)
# http://httpd.apache.org/docs/2.0/mod/mod_headers.html
Header unset Last-Modified
Header add "Cache-Control" “public”