-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
.htaccess
93 lines (68 loc) · 3.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
# rewrite to NON-WWW
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteCond %{HTTP_HOST} !=localhost
RewriteRule ^(.*)$ https://osekai.net/$1 [R=301,L]
# rewrite to HTTPS
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} =osekai.net
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
#Header always set Content-Security-Policy "upgrade-insecure-requests;"
# ^ need to make sure that these updates dont break prod
# shit ton of caching
ExpiresActive On
ExpiresByType text/css "access plus 1 weeks"
ExpiresByType application/javascript "access plus 1 weeks"
ExpiresByType application/x-javascript "access plus 1 weeks"
ExpiresByType image/x-icon "access plus 1 months"
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpg A2592000
ExpiresByType image/jpeg A2592000
SetEnv no-gzip dont-vary
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/shtml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/php
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
DirectoryIndex index.php
# 404 doc
ErrorDocument 404 /404/index.php
ErrorDocument 503 '<link rel="preconnect" href="https://fonts.gstatic.com"><link href="https://fonts.googleapis.com/css2?family=Comfortaa:wght@300;400;500;600;700&display=swap" rel="stylesheet"><style> *{ padding: 0px; margin: 0px; color: #fff; font-family: "Comfortaa"; } body{ background-color: #0b0c11; }</style><div style="height: 100vh; width: 100vw; display: flex; flex-direction: column; justify-content: center; align-content: center; justify-items: center; align-items: center;"><h1>Oh no, our servers seem to be having a little trouble.</h1><p>Please try again in a bit.</p></div>'
# ! < TOOLS REWRITING > ! #
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^tools\/(.*)$ /tools/tool.php?page=$1 [NC,L,QSA]
RedirectMatch 404 ^/tools/src/(.*)/index.php$
# ! </ TOOLS REWRITING > ! #
# ! < TEAMS REWRITING > ! #
# ! </ TEAMS REWRITING > ! #
# tempdown
#RewriteRule profiles(.*)$ /tempdown.html [L]
#RewriteRule snapshots(.*)$ /tempdown.html [L]
#RewriteRule rankings(.*)$ /tempdown.html [L]
<If "%{REMOTE_ADDR} != 'ip1' && %{REMOTE_ADDR} != 'ip2' && %{REMOTE_ADDR} != 'ip3'">
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^(.*)$ /offline-work.html [L]
</If>
<FilesMatch ".(eot|otf|ttf|woff|woff2)">
Header always set Access-Control-Allow-Origin "*"
</FilesMatch>
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php [NC,L]
# ! reason for comment: causes every url which should 404 to instead go to teams, breaks half the sites
# (tldr do this in a .htaccess in the /teams/ folder instead)
#RewriteBase /teams/
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^(.+)$ router.php [QSA,L]