-
Notifications
You must be signed in to change notification settings - Fork 1
/
.htaccess
33 lines (27 loc) · 1.3 KB
/
.htaccess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Enable the rewrite engine
RewriteEngine On
# Force HTTPS
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.teendevops.net/$1 [R,L]
# Block access to /phpmyadmin, if exists
RewriteRule ^(/phpmyadmin) - [F,L,NC]
# Rewrite url parameters
RewriteRule ^profile/([^/]+)/?$ /profile.php?username=$1 [L]
RewriteRule ^profiles/([^/]+)/?$ /profile.php?username=$1 [L]
RewriteRule ^users/([^/]+)/?$ /profile.php?username=$1 [L]
RewriteRule ^user/([^/]+)/?$ /profile.php?username=$1 [L]
RewriteRule ^chat/([^/]+)/?$ /chat.php?channel=$1 [L]
RewriteRule ^channel/([^/]+)/?$ /chat.php?channel=$1 [L]
# Append .php if that file exists (internal rewrite)
RewriteCond %{DOCUMENT_ROOT}/$1.php -f
RewriteRule (.*?)/?$ $1.php [L]
# Enable security headers
Header set X-Frame-Options DENY
Header set X-Content-Type-Options "nosniff"
Header set X-XSS-Protection "1; mode=block"
Header set Referrer-Policy no-referrer
Header set X-Easter-Egg "You found an easter egg: e4st3r_egg_5"
Header set Strict-Transport-Security "max-age=31536000; includeSubdomains" env=HTTPS
Header set Content-Security-Policy "script-src 'self' https://teendevops.net https://*.teendevops.net https:;"
# Disabled security headers below...
# Header always set Public-Key-Pins "pin-sha256=\"VetzveJCgWcgnxPMy9CdWWK7IOwBa/CgNXms6Gmhq6g=\"; max-age=5184000"