.htaccess 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <IfModule mod_dir.c>
  2. DirectoryIndex index.php index.html
  3. </IfModule>
  4. FileETag None
  5. AddDefaultCharset UTF-8
  6. <IfModule mod_mime.c>
  7. AddType application/javascript .js
  8. AddType application/json .map
  9. AddCharset UTF-8 .html
  10. AddCharset UTF-8 .js
  11. </IfModule>
  12. <IfModule mod_deflate.c>
  13. AddOutputFilterByType DEFLATE application/javascript application/json application/xhtml+xml image/svg+xml text/css text/html
  14. </IfModule>
  15. <IfModule mod_expires.c>
  16. ExpiresActive on
  17. ExpiresDefault "access plus 1 month"
  18. ExpiresByType application/javascript "access plus 1 month"
  19. ExpiresByType application/xhtml+xml "access plus 1 month"
  20. ExpiresByType image/x-icon "access plus 1 month"
  21. ExpiresByType text/html "access plus 1 month"
  22. <FilesMatch "\.php$">
  23. ExpiresActive Off
  24. </FilesMatch>
  25. </IfModule>
  26. <IfModule mod_headers.c>
  27. <FilesMatch "\.(css|gif|html|ico|js|png|svg|woff|woff2)$">
  28. Header merge Cache-Control "public"
  29. </FilesMatch>
  30. Header edit Set-Cookie ^(.*)$ "$1; SameSite=Lax"
  31. </IfModule>
  32. # Provide the true IP address of the connection (e.g. last proxy), even when using mod_remoteip
  33. <IfModule mod_rewrite.c>
  34. RewriteEngine on
  35. RewriteRule .* - [E=CONN_REMOTE_ADDR:%{CONN_REMOTE_ADDR}]
  36. </IfModule>
  37. <IfModule !mod_rewrite.c>
  38. <IfModule mod_setenvif.c>
  39. # If you run an old Apache 2.2-, disable mod_setenvif and enable mod_rewrite, or comment out next line
  40. SetEnvIfExpr "%{CONN_REMOTE_ADDR} =~ /(.*)/" CONN_REMOTE_ADDR=$1
  41. </IfModule>
  42. </IfModule>