forked from SteamLUG/steamlug.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
62 lines (49 loc) · 1.93 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
# DirectoryIndex news.php
IndexIgnore *.php *.flac
Options -Indexes
ErrorDocument 403 /error-page/403.php
ErrorDocument 404 /error-page/404.php
ErrorDocument 500 /error-page/500.php
ServerSignature Off
AddType image/svg+xml .svg
AddOutputFilterByType DEFLATE image/svg+xml
RewriteBase /
RewriteEngine on
# Strip www. from www.steamlug.org
# shall not match any other subdomains (staging, archive, ...)
RewriteCond %{HTTP_HOST} ^www\.steamlug\.org$ [NC]
RewriteRule ^(.*)$ http://steamlug.org/$1 [R=301,L]
# Redirect every non https request to https, except feed/cast/mp3 or feed/cast.php?t=mp3 (for itunes)
RewriteCond %{HTTPS} off
RewriteCond %{THE_REQUEST} !^GET\ /feed/cast(/mp3|\.php\?t=mp3)\ HTTP/ [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
# if remote uri refers to a valid directory, stop
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^(.*)$ - [L]
RewriteCond %{DOCUMENT_ROOT}/$1.php -f
RewriteRule ^((.*/)*[^./]+)/*$ $1.php [L]
RewriteRule ^cast/s(\d+)e(\d+)$ cast.php?s=$1&e=$2 [NC,L]
RewriteRule ^feed/cast/(\w+)$ feed/cast.php?t=$1 [NC,L]
RewriteRule ^youtubethumb/s(\d+)e(\d+)$ youtubethumb/?s=$1&e=$2 [NC,L]
RewriteRule ^youtubedescription/s(\d+)e(\d+)$ youtubedescription/?s=$1&e=$2 [NC,L]
RewriteRule ^app/(\d+)$ app.php?appid=$1 [NC,L]
RewriteRule ^events/(\w+)$ events.php?eventid=$1 [NC,L]
RewriteRule ^polls/(\d+)$ polls.php?pollid=$1 [NC,L]
RewriteRule ^member/(\w+)$ member.php?uid=$1 [NC,L]
RewriteRule ^clan/(\w+)$ clan.php?clanid=$1 [NC,L]
RewriteRule ^apple-touch-icon(.*).png$ mobile-favicon.png [L]
<ifmodule mod_expires.c>
<FilesMatch "\.(png|gif|jpg|jpeg|ico|woff|eot|ttf)$">
ExpiresActive On
ExpiresDefault "access plus 2 weeks"
Header append Cache-Control "public"
</FilesMatch>
<FilesMatch "\.(css|js|svg)$">
ExpiresActive On
ExpiresDefault "access plus 1 week"
Header append Cache-Control "public"
</FilesMatch>
</ifmodule>
<ifmodule mod_mime.c>
AddType application/x-font-ttf .ttf
</ifmodule>