|
# http://typo3.org/teams/security/security-bulletins/typo3-20080611-1/
|
|
<FilesMatch "\.php[3456]?\..*$">
|
|
ForceType text/plain
|
|
</FilesMatch>
|
|
|
|
|
|
#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 <base> tag
|
|
# http://typo3bloke.net/post-details/archive/2008/may/26/check_your_404_traffic/
|
|
<IfModule mod_rewrite.c>
|
|
RewriteEngine On
|
|
RewriteCond %{REQUEST_URI} ^.+(/(fileadmin|uploads|typo3conf|typo3temp)/.*)
|
|
RewriteRule ^.*$ %1 [L,R=301]
|
|
#RewriteLog "/home/httpd/logs/rewrite.log"
|
|
#RewriteLogLevel 4
|
|
</IfModule>
|
|
|
|
|
|
# Enable compression (reduce traffic by 70%)
|
|
# http://httpd.apache.org/docs/2.0/mod/mod_deflate.html
|
|
<IfModule mod_deflate.c>
|
|
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
|
|
</IfModule>
|
|
|
|
|
|
# Send expiry headers for files that do not change often
|
|
# http://httpd.apache.org/docs/2.0/mod/mod_expires.html
|
|
<IfModule mod_expires.c>
|
|
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"
|
|
</IfModule>
|
|
|
|
|
|
# Do not cache the main php files in /typo3
|
|
<FilesMatch "(/typo3/(index.php|install/index.php|backend.php|alt_doc.php)).*">
|
|
ExpiresActive Off
|
|
</FilesMatch>
|
|
|
|
|
|
# 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
|
|
<IfModule mod_headers.c>
|
|
<FilesMatch "\.(?i:ico|png|gif|js|css|jpe?g)">
|
|
Header unset Last-Modified
|
|
</FilesMatch>
|
|
<Files /clear.gif>
|
|
Header add "Cache-Control" “public”
|
|
</Files>
|
|
</IfModule>
|