Apache Lounge



Forum Index Downloads Search Register Log in  RSS Apache Lounge

Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.



A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.

Header set X-XSS-Protection "1; mode=block" -- not

Post new topic   Reply to topic    Apache Forum Index -> Apache

View previous topic :: View next topic  
Author Message

Joined: 26 Aug 2011
Posts: 20
Location: Middlesex University

PostPosted: Tue 17 Oct '17 14:49    Post subject: Header set X-XSS-Protection "1; mode=block" -- not Reply with quote

I am having trouble getting the directive

Header set X-XSS-Protection "1; mode=block"

to have any effect.

My question:

In my websites various conf files, I have this stanza:

<IfModule mod_headers.c>
# Allow some urls, block all others; whitelisting
<LocationMatch ^((?!(xxxxxx)).)*$>
Header always append X-Frame-Options SAMEORIGIN
Header always append X-Frame-Options "ALLOW-FROM http://xxxxxxxx.azurewebsites.net/"
Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure
Header set X-XSS-Protection "1; mode=block"

Will the directive <IfModule mod_headers.c> take effect if

LoadModule headers_module modules/mod_headers.so

is in the httpd.conf file, or does it also have to be in any <VirtualHost> stanzas which make use of it? Or should it be

<IfModule headers_module>?

Please advise.

Many thanks.
Back to top

Joined: 15 Oct 2005
Posts: 2679
Location: Hilversum, NL, EU

PostPosted: Thu 19 Oct '17 14:16    Post subject: Reply with quote

See http://httpd.apache.org/docs/2.4/en/mod/core.html#ifmodule
Back to top

Post new topic   Reply to topic    Apache Forum Index -> Apache
Page 1 of 1