Posted By

tscheckenbach on 05/02/10


Tagged

htaccess typo3 rewrite deflate etag


Versions (?)

Typo3 .htacces


 / Published in: Apache
 

  1. <IfModule mod_rewrite.c>
  2.  
  3. RewriteEngine On
  4. RewriteRule ^(typo3/|t3lib/|tslib/|fileadmin/|typo3conf/|typo3temp/|uploads/|showpic\.php|favicon\.ico) - [L]
  5. RewriteRule ^typo3$ typo3/index_re.php [L]
  6. RewriteCond %{REQUEST_FILENAME} !-f
  7. RewriteCond %{REQUEST_FILENAME} !-d
  8. RewriteCond %{REQUEST_FILENAME} !-l
  9. RewriteRule .* index.php [L]
  10.  
  11. </IfModule>
  12.  
  13.  
  14. <FilesMatch "\.(js|css|html|htm|php|xml)$">
  15. SetOutputFilter DEFLATE
  16. </FilesMatch>
  17.  
  18. # Etags braucht kein Mensch, so bekommen wir in YSlow ein A, bzw. B wegen dem favicon
  19. FileETag none
  20.  
  21.  
  22. #Expire Header - Dateien des angegebenen Typs ändern sich eigentlich nicht mehr, also holen wir diese aus dem Browser-Cache
  23. # Turn on Expires and set default to 0
  24. ExpiresActive On
  25. ExpiresDefault A0
  26.  
  27. # Set up caching on media files for 1 year (forever?)
  28. <FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
  29. ExpiresDefault A29030400
  30. Header append Cache-Control "public"
  31. </FilesMatch>
  32.  
  33. # Set up caching on media files for 1 week
  34. <FilesMatch "\.(gif|jpg|jpeg|png|ico|swf|css|js)$">
  35. ExpiresDefault A604800
  36. Header append Cache-Control "public"
  37. </FilesMatch>
  38.  
  39. # Set up 2 Hour caching on commonly updated files
  40. <FilesMatch "\.(xml|txt|html)$">
  41. ExpiresDefault A7200
  42. Header append Cache-Control "proxy-revalidate"
  43. </FilesMatch>
  44.  
  45. # Force no caching for dynamic files
  46. <FilesMatch "\.(php|cgi|pl|htm)$">
  47. ExpiresActive Off
  48. Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
  49. Header set Pragma "no-cache"
  50. </FilesMatch>

Report this snippet  

You need to login to post a comment.