.htaccess 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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_setenvif.c>
  34. SetEnvIfExpr "%{CONN_REMOTE_ADDR} =~ /(.*)/" CONN_REMOTE_ADDR=$1
  35. </IfModule>
  36. <IfModule !mod_setenvif.c>
  37. <IfModule mod_rewrite.c>
  38. RewriteEngine on
  39. RewriteRule .* - [E=CONN_REMOTE_ADDR:%{CONN_REMOTE_ADDR}]
  40. </IfModule>
  41. </IfModule>