I would like to configure Apache so
that
- it normally denies
requests for iFrames (for instance, by settingHeader always append
)
X-Frame-Options
DENY - but, it
allows a specific directory to be embedded as iFrame, independently from the origin of
the request (for instance,src="www.mysite.com/mydir">
)
Is
that possible?
See
documentation for href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options"
rel="nofollow noreferrer">X-Frame-Options
. You
can
allow
embedding from
https://example.com/mydir
:Header
always append X-Frame-Options
ALLOW-FROM=https://example.com/mydirallow
embedding of
https://example.com/mydir
by adding it only when
Location
doesn't match/mydir
, with
the rel="nofollow noreferrer">LocationMatch
directive.*:80>
ServerName example.com
"^/(?!mydir)(.*)">
Header always append X-Frame-Options DENY
to
maximize security, add a combination of these i.e. only allow embedding of
/mydir
from
...
.
You
can't limit it to alone, but the embedding can
also be done as or
.
Comments
Post a Comment