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?
You could do this (untested)
Something similar is detailed in Apache docs: https://httpd.apache.org/docs/current/mod/mod_headers.html