.htaccess 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. Options -MultiViews
  2. #
  3. # REWRITES
  4. #
  5. # Used to: Force https.
  6. #
  7. <IfModule mod_rewrite.c>
  8. # Force https
  9. RewriteCond %{HTTPS} !=on
  10. RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
  11. </ifModule>
  12. #
  13. # FALLBACKRESOURCE
  14. #
  15. # Used to: all pages to index.php
  16. #
  17. FallbackResource /index.php
  18. #
  19. # EXPIRES
  20. #
  21. # Used to: control the cache times of the different files on the server.
  22. #
  23. <IfModule mod_expires.c>
  24. ExpiresActive on
  25. ExpiresDefault "access plus 2 days"
  26. ExpiresByType application/javascript "access plus 6 days"
  27. ExpiresByType image/x-ico "access plus 12 days"
  28. ExpiresByType image/jpg "access plus 12 days"
  29. ExpiresByType image/jpeg "access plus 12 days"
  30. ExpiresByType image/gif "access plus 12 days"
  31. ExpiresByType image/png "access plus 12 days"
  32. ExpiresByType video/mkv "access plus 12 days"
  33. #ExpiresByType text/css "access plus 6 days"
  34. ExpiresByType text/plain "access plus 6 days"
  35. </IfModule>
  36. #
  37. # HEADERS
  38. #
  39. # Used to: control the cache times of the different files on the client.
  40. #
  41. <ifModule mod_headers.c>
  42. <filesMatch "\.(ico|jpe?g|png|gif|swf)$">
  43. Header set Cache-Control "max-age=864000, public, must-revalidate"
  44. </filesMatch>
  45. # <filesMatch "\.(css)$">
  46. # Header set Cache-Control "max-age=864000, public, must-revalidate"
  47. # </filesMatch>
  48. <filesMatch "\.(js)$">
  49. Header set Cache-Control "max-age=864000, private, must-revalidate"
  50. </filesMatch>
  51. <filesMatch "\.(x?html?|php)$">
  52. Header set Cache-Control "max-age=86400, private, must-revalidate"
  53. </filesMatch>
  54. </ifModule>
  55. AddType image/svg+xml svg svgz
  56. <ifModule mod_deflate.c>
  57. AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain
  58. AddOutputFilterByType DEFLATE image/x-icon
  59. AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml
  60. AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml
  61. AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript application/json
  62. AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-otf
  63. AddOutputFilterByType DEFLATE font/truetype font/opentype
  64. </ifModule>
  65. #
  66. # ERROR
  67. #
  68. # Used to: redirect to nice error pages.
  69. #
  70. ErrorDocument 400 /error.php
  71. ErrorDocument 401 /error.php
  72. ErrorDocument 403 /error.php
  73. ErrorDocument 404 /error.php
  74. ErrorDocument 500 /error.php