1

I have Apache 2.4.18 (security patched) but due to hosting restrictions I can't change the configuration files only .htaccess. mod_headers is enabled and I would like to run a Header directive only when www.example.com/ is accessed (with or without trailing slash). LocationMatch '^/$' is not allowed in .htaccess. Now what?

1 Answer 1

1

You could do this (untested)

 Header always set CustomHeader my-value "expr=%{REQUEST_URI} =~ m#^/+$#"

Something similar is detailed in Apache docs: https://httpd.apache.org/docs/current/mod/mod_headers.html

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .