Nirjonadda
Well-known member
I want to secure website from Headers Policy. Please let me know that does Xenforo compatible/supported or no issue from enable HTTP Security Headers? I have issue from Content Security Policy, Xenforo style go broken if enable CSP, I am now disabled CSP. Please let me know that how I can re-enable CSP?
HTTP Security Headers via .htaccess
All HTTP Security, Simple Ways to Secure Your Website ...
HTTP Security Headers via .htaccess
Code:
RewriteEngine On
# Force www:
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# Force SSL:
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
# Security header Enable HSTS
Header set Strict-Transport-Security "max-age=31536000" env=HTTPS
# Security header Enable CSP
# Header set Content-Security-Policy "default-src 'self'"
# Turn on IE8-IE9 XSS prevention tools
Header set X-XSS-Protection "1; mode=block"
# Referrer-Policy
Header set Referrer-Policy "no-referrer-when-downgrade"
All HTTP Security, Simple Ways to Secure Your Website ...
Code:
RewriteEngine On
# Force SSL:
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Force www:
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [E=HTTPS,R=301,L]
# Security header Enable HSTS
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" env=HTTPS
# Security header Enable CSP
# Header always set Content-Security-Policy "default-src 'self'"
# Turn on IE8-IE9 XSS prevention tools
Header always set X-XSS-Protection "1; mode=block"
# Referrer-Policy
Header always set Referrer-Policy "no-referrer-when-downgrade"
# HTTP Public Key Pinning
Header always set Public-Key-Pins "pin-sha256=\"base64+primary==\"; pin-sha256=\"base64+backup==\"; max-age=5184000; includeSubDomains"
# Secure cookie with HttpOnly
Header always edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure
# X-Permitted-Cross-Domain-Policies
Header always set X-Permitted-Cross-Domain-Policies "none"
Last edited: