-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
32 lines (23 loc) · 1012 Bytes
/
.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
RewriteEngine On
RewriteBase /
# Files
RewriteCond files%{REQUEST_URI} -F
RewriteRule ^([a-z]+?)/([1-9]+?)\.([a-z0-9]+)$ /lib/endpoints/log.php?project=$1&episode=$2&extension=$3 [L]
# Relive
RewriteRule ^([a-z]+?)/([1-9]+?)\.relive$ /lib/endpoints/log.php?project=$1&episode=$2_relive&extension=mp3 [L]
# Nonexisting files
RewriteRule ^([a-z]+?/[1-9]*\.[a-z0-9]+)$ /lib/endpoints/404.php?type=file [L]
# API requests from cache (episodes and listing)
RewriteCond cache%{REQUEST_URI}.json -F
RewriteRule ^([a-z]+/([1-9]+|all))$ cache/$1.json [L]
# API requests from cache (projects)
RewriteCond cache%{REQUEST_URI}/index.json -F
RewriteRule ^([a-z]+)/?$ cache/$1/index.json [L]
# API request for index page
RewriteRule ^$ cache/index.json [L]
# Live stream
RewriteRule ^live(?:/([a-z]*)/?)?$ lib/endpoints/live.php?project=$1 [L]
# Tasks
RewriteRule ^task(?:/([a-z]*)/?([a-z0-9:]*)/?)?$ lib/endpoints/task.php?task=$1&args=$2 [L]
# Everything else
ErrorDocument 404 /lib/endpoints/404.php?type=endpoint