Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1.  
  2. <IfModule mod_rewrite.c>
  3. <IfModule mod_negotiation.c>
  4. Options -MultiViews
  5. </IfModule>
  6.  
  7. RewriteEngine On
  8.  
  9. # Redirect Trailing Slashes If Not A Folder...
  10. RewriteCond %{REQUEST_FILENAME} !-d
  11. RewriteRule ^(.*)/$ /$1 [L,R=301]
  12.  
  13. # Handle Front Controller...
  14. RewriteCond %{REQUEST_FILENAME} !-d
  15. RewriteCond %{REQUEST_FILENAME} !-f
  16. RewriteRule ^ index.php [L]
  17.  
  18. # Handle Authorization Header
  19. RewriteCond %{HTTP:Authorization} .
  20. RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  21.  
  22.  
  23. </IfModule>
  24.  
  25. <ifModule mod_headers.c>
  26. #кэшировать html и htm файлы на один день
  27. <FilesMatch "\.(html|htm)$">
  28. Header set Cache-Control "max-age=43200"
  29. </FilesMatch>
  30. #кэшировать css, javascript и текстовые файлы на одну неделю
  31. <FilesMatch "\.(js|css|txt)$">
  32. Header set Cache-Control "max-age=604800"
  33. </FilesMatch>
  34. #кэшировать флэш и изображения на месяц
  35. <FilesMatch "\.(flv|swf|ico|gif|jpg|jpeg|png)$">
  36. Header set Cache-Control "max-age=2592000"
  37. </FilesMatch>
  38. #отключить кэширование
  39. <FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
  40. Header unset Cache-Control
  41. </FilesMatch>
  42. </IfModule>
  43.  
  44. <ifModule mod_expires.c>
  45. ExpiresActive On
  46. #по умолчанию кеш в 5 секунд
  47. ExpiresDefault "access plus 5 seconds"
  48. #кэшировать флэш и изображения на месяц
  49. ExpiresByType image/x-icon "access plus 2592000 seconds"
  50. ExpiresByType image/jpeg "access plus 2592000 seconds"
  51. ExpiresByType image/png "access plus 2592000 seconds"
  52. ExpiresByType image/gif "access plus 2592000 seconds"
  53. ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
  54. #кэшировать css, javascript и текстовые файлы на одну неделю
  55. ExpiresByType text/css "access plus 604800 seconds"
  56. ExpiresByType text/javascript "access plus 604800 seconds"
  57. ExpiresByType application/javascript "access plus 604800 seconds"
  58. ExpiresByType application/x-javascript "access plus 604800 seconds"
  59. #кэшировать html и htm файлы на один день
  60. ExpiresByType text/html "access plus 43200 seconds"
  61. #кэшировать xml файлы на десять минут
  62. ExpiresByType application/xhtml+xml "access plus 600 seconds"
  63. </ifModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement