.htaccess 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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_filter.c>
  17. <IfModule mod_deflate.c>
  18. AddOutputFilterByType DEFLATE application/javascript application/json application/xhtml+xml image/svg+xml text/css text/html
  19. </IfModule>
  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>