.htaccess 1.7 KB

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