.htaccess 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # If you need custom .htaccess rules, instead of modifying this file,
  2. # create one in `./i/.htaccess` (in particular for access control such as HTTP Basic Auth),
  3. # or in `../.htaccess` for other more general rules.
  4. # See also `../.htaccess.dist` if you cannot set Apache `DocumentRoot` to here (`FreshRSS/p/`) as recommended
  5. <IfModule mod_dir.c>
  6. DirectoryIndex index.php index.html
  7. </IfModule>
  8. FileETag None
  9. AddDefaultCharset UTF-8
  10. <IfModule mod_mime.c>
  11. AddType application/javascript .js
  12. AddType application/json .map
  13. AddCharset UTF-8 .html
  14. AddCharset UTF-8 .js
  15. </IfModule>
  16. <IfModule mod_deflate.c>
  17. AddOutputFilterByType DEFLATE application/javascript application/json application/xhtml+xml image/svg+xml text/css text/html
  18. </IfModule>
  19. <IfModule mod_expires.c>
  20. ExpiresActive on
  21. ExpiresDefault "access plus 1 month"
  22. ExpiresByType application/javascript "access plus 1 month"
  23. ExpiresByType application/xhtml+xml "access plus 1 month"
  24. ExpiresByType image/x-icon "access plus 1 month"
  25. ExpiresByType text/html "access plus 1 month"
  26. <FilesMatch "\.php$">
  27. ExpiresActive Off
  28. </FilesMatch>
  29. </IfModule>
  30. <IfModule mod_headers.c>
  31. <FilesMatch "\.(css|gif|html|ico|js|png|svg|woff|woff2)$">
  32. Header merge Cache-Control "public"
  33. </FilesMatch>
  34. Header edit Set-Cookie ^(.*)$ "$1; SameSite=Lax"
  35. </IfModule>
  36. # Provide the true IP address of the connection (e.g. last proxy), even when using mod_remoteip
  37. <IfModule mod_rewrite.c>
  38. RewriteEngine on
  39. RewriteRule .* - [E=CONN_REMOTE_ADDR:%{CONN_REMOTE_ADDR}]
  40. </IfModule>
  41. <IfModule !mod_rewrite.c>
  42. <IfModule mod_setenvif.c>
  43. # If you run an old Apache 2.2-, disable mod_setenvif and enable mod_rewrite, or comment out next line
  44. SetEnvIfExpr "%{CONN_REMOTE_ADDR} =~ /(.*)/" CONN_REMOTE_ADDR=$1
  45. </IfModule>
  46. </IfModule>