-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.htaccess
22 lines (19 loc) · 1006 Bytes
/
.htaccess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#copy to .htaccess file in root directory or create that file and copy this gits content to it
#you need to modify this for your self, specially the Content-Security-Policy part.
#Secure Header
<IfModule mod_headers.c>
Header always set X-Frame-Options DENY
Header always set X-Xss-Protection "1; mode=block"
Header always set X-Content-Type-Options "nosniff"
Header always set Content-Security-Policy "script-src 'self'; object-src 'self'"
Header always set Referrer-Policy "no-referrer"
Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains;"
Header always set Feature-Policy "accelerometer 'none'; camera 'none'; geolocation 'none'; gyroscope 'none'; magnetometer 'none'; microphone 'none'; payment 'none'; usb 'none'"
</IfModule>
#https://www.askapache.com/htaccess/http-https-rewriterule-redirect/
#https redirection
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>