# If you need custom .htaccess rules, instead of modifying this file,
# create one in `./i/.htaccess` (in particular for access control such as HTTP Basic Auth),
# or in `../.htaccess` for other more general rules.
# See also `../.htaccess.dist` if you cannot set Apache `DocumentRoot` to here (`FreshRSS/p/`) as recommended
DirectoryIndex index.php index.html
FileETag None
AddDefaultCharset UTF-8
AddType application/javascript .js
AddType application/json .map
AddCharset UTF-8 .html
AddCharset UTF-8 .js
AddOutputFilterByType DEFLATE application/javascript application/json application/xhtml+xml image/svg+xml text/css text/html
ExpiresActive on
ExpiresDefault "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType application/xhtml+xml "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 month"
ExpiresByType text/html "access plus 1 month"
ExpiresActive Off
Header merge Cache-Control "public"
# For requests like `frss.css?1746304092`
Header merge Cache-Control "immutable"
# Provide the true IP address of the connection (e.g. last proxy), even when using mod_remoteip
RewriteEngine on
RewriteRule .* - [E=CONN_REMOTE_ADDR:%{CONN_REMOTE_ADDR}]
SetEnvIfExpr "%{CONN_REMOTE_ADDR} =~ /(.*)/" CONN_REMOTE_ADDR=$1
# Log remote user with same priority as FreshRSS_http_Util::httpAuthUser(). See also api/.htaccess
SetEnvIfExpr "reqenv('LOG_REMOTE_USER') == ''" LOG_REMOTE_USER=-
SetEnvIfExpr "reqenv('LOG_REMOTE_USER') == '-' && reqenv('REMOTE_USER') =~ /(.+)/" LOG_REMOTE_USER=$1
SetEnvIfExpr "reqenv('LOG_REMOTE_USER') == '-' && reqenv('REDIRECT_REMOTE_USER') =~ /(.+)/" LOG_REMOTE_USER=$1
SetEnvIfExpr "reqenv('LOG_REMOTE_USER') == '-' && req('Remote-User') =~ /(.+)/" LOG_REMOTE_USER=$1
SetEnvIfExpr "reqenv('LOG_REMOTE_USER') == '-' && req('X-WebAuth-User') =~ /(.+)/" LOG_REMOTE_USER=$1