I'm trying to conditionally unset X-Frame-Options
in an .htaccess
file if the request URL begins with /store
. This is the code I am working with in .htaccess
:
# Allow store iframe to be loaded from all locations
SetEnvIf Request_URI "^/store" iframe
Header always unset X-Frame-Options env=iframe
But this isn't working and the X-Frame-Options
header continues to be sent.
The web server is running Apache 2.2.
If I remove the SetEnvIf
line and the env=iframe
part of the third line the X-Frame-Options
header is removed. What is wrong with my SetEnvIf
condition?