Categories
Uncategorized

X-Security Headers for Apache / .htaccess for Security purpose

Open your .htaccess file and paste below Code in that. WordPress / CodeIgniter / Magento / Opencart / Joomla

 

### X-Security Headers ###

# X-XSS-Protection
<IfModule mod_headers.c>
Header set X-XSS-Protection "1; mode=block"
</IfModule>

# X-Frame-Options
<IfModule mod_headers.c>
Header always append X-Frame-Options SAMEORIGIN
</IfModule>

# X-Content-Type nosniff
<IfModule mod_headers.c>
Header set X-Content-Type-Options nosniff
</IfModule>

# Extra Security Headers
<IfModule mod_headers.c>
Header set X-XSS-Protection "1; mode=block"
Header always append X-Frame-Options SAMEORIGIN
Header set X-Content-Type-Options nosniff
</IfModule>

# Strict-Transport-Security security header
<IfModule mod_headers.c> 
Header set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" 
</IfModule>
### X-Security Headers ###