0
votes

In httpd.conf (Unix / Mac OS Sierra) I've got "Header set X-Frame-Options SAMEORIGIN"

I'd like to override that for a specific directory to X-Frame-Options ALLOW-FROM SpecificDomain.com

Goal is to allow iframe acess to that directory but no others.

I tried adding the ALLOW-FROM line to an .htaccess file in the target directory but no luck. iFrame is denied, browser console saying "X-Frame-Options" are set to "SAMEORIGIN"

1

1 Answers

0
votes

There are compatibility issues with some browsers with the Allow-From parameter for X-Frame-Options response header, chances are you are dealing with a browser which does not support it.

Ideally try this command to see the headers output and make sure the setting you made is being used:

curl -I http://yourserver.example.com/exceptionpath/

If it is, instead of setting that other header you may also want to unset that header in that directory to avoid compatibility issues with that parameter:

Header unset X-Frame-Options

or if the above is not being applied:

Header always unset X-Frame-Options


Sidenote: If you are the admin of the site you don't need to use .htaccess if you have access to main configuration files, set in the appropiate Directory entry instead. Disable .htaccess files altogether with AllowOverride none. Configurations will be simpler and you will gain a bit of performance by not forcing httpd to constantly read that file several times with each hit.