-
Notifications
You must be signed in to change notification settings - Fork 0
/
.httpd.conf.extract.txt
executable file
·94 lines (84 loc) · 6.87 KB
/
.httpd.conf.extract.txt
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
# Timetables Apache directives
# Load using:
# # Timetables system
# Include /path/to/timetables/.httpd.conf.extract.txt
# Use MacroTemplateApplication /timetables
# Timetables
<Macro MacroTimetables $baseUrl>
# Front controller application support
Use MacroFrontControllerApplication "$baseUrl/" "Timetables"
<Location $baseUrl/>
php_value output_buffering 65536
</Location>
# Application routing
# Timetable viewing URLs
# Browse/'My' timetable
RewriteRule ^$baseUrl/(|timetable.ics|export.html|timetable.csv)$ $baseUrl/index.html?export=$1 [L,QSA]
RewriteRule ^$baseUrl/reset.html$ $baseUrl/index.html?reset=1 [L,QSA]
RewriteRule ^$baseUrl/(browse|my|today)/(|timetable.ics|export.html|timetable.csv)$ $baseUrl/index.html?action=$1&export=$2 [L,QSA]
RewriteRule ^$baseUrl/(browse|my|today)$ $baseUrl/$1/ [R]
# Natural dates; these may have an optional /type/id/ prefix, e.g. /activities/2/2012/, using this optional regexp block: ((activities|people|rooms)/([a-zA-Z0-9]+)/)?
# Year only
RewriteRule ^$baseUrl/((activities|people|rooms)/([^/]+)/)?(20[0-3][0-9])/(|timetable.ics|export.html|timetable.csv)$ $baseUrl/index.html?action=browse&do=list&year=$4&object=$2&id=$3&export=$5 [L,QSA]
RewriteRule ^$baseUrl/((activities|people|rooms)/([^/]+)/)?(20[0-3][0-9])$ $baseUrl/$1$4/ [R=301]
# Year and month
RewriteRule ^$baseUrl/((activities|people|rooms)/([^/]+)/)?(20[0-3][0-9])/(january|february|march|april|may|june|july|august|september|october|november|december)/(|timetable.ics|export.html|timetable.csv)$ $baseUrl/index.html?action=browse&do=list&year=$4&month=$5&object=$2&id=$3&export=$6 [L,QSA]
RewriteRule ^$baseUrl/((activities|people|rooms)/([^/]+)/)?(20[0-3][0-9])/(january|february|march|april|may|june|july|august|september|october|november|december)$ $baseUrl/$1$4/$5/ [R=301]
# Year, month and day
RewriteRule ^$baseUrl/((activities|people|rooms)/([^/]+)/)?(20[0-3][0-9])/(january|february|march|april|may|june|july|august|september|october|november|december)/([1-3]?[0-9])/(|timetable.ics|export.html|timetable.csv)$ $baseUrl/index.html?action=browse&do=list&year=$4&month=$5&day=$6&object=$2&id=$3&export=$7 [L,QSA]
RewriteRule ^$baseUrl/((activities|people|rooms)/([^/]+)/)?(20[0-3][0-9])/(january|february|march|april|may|june|july|august|september|october|november|december)/([1-3]?[0-9])$ $baseUrl/$1$4/$5/$6/ [R=301]
# Custom years/terms/weeks
# Custom year
RewriteRule ^$baseUrl/((activities|people|rooms)/([^/]+)/)?(20[0-3][0-9]-[0-3][0-9])/(|timetable.ics|export.html|timetable.csv)$ $baseUrl/index.html?action=browse&do=list&customyear=$4&object=$2&id=$3&export=$5 [L,QSA]
RewriteRule ^$baseUrl/((activities|people|rooms)/([^/]+)/)?(20[0-3][0-9]-[0-3][0-9])$ $baseUrl/$1$4/ [R=301]
# Custom year and term
RewriteRule ^$baseUrl/((activities|people|rooms)/([^/]+)/)?(20[0-3][0-9]-[0-3][0-9])/([a-z0-9]+)/(|timetable.ics|export.html|timetable.csv)$ $baseUrl/index.html?action=browse&do=list&customyear=$4&term=$5&object=$2&id=$3&export=$6 [L,QSA]
RewriteRule ^$baseUrl/((activities|people|rooms)/([^/]+)/)?(20[0-3][0-9]-[0-3][0-9])/([a-z0-9]+)$ $baseUrl/$1$4/$5/ [R=301]
# Custom year, term and week number
RewriteRule ^$baseUrl/((activities|people|rooms)/([^/]+)/)?(20[0-3][0-9]-[0-3][0-9])/([a-z0-9]+)/week([0-9]+)/(|timetable.ics|export.html|timetable.csv)$ $baseUrl/index.html?action=browse&do=list&customyear=$4&term=$5&customweek=$6&object=$2&id=$3&export=$7 [L,QSA]
RewriteRule ^$baseUrl/((activities|people|rooms)/([^/]+)/)?(20[0-3][0-9]-[0-3][0-9])/([a-z0-9]+)/week([0-9]+)$ $baseUrl/$1$4/$5/week$6/ [R=301]
# Activities/people/rooms: These are routed via CRUD as they map to objects rather than being dynamic views
# People consolidation
RewriteRule ^$baseUrl/people/(consolidate)/$ $baseUrl/index.html?action=$1 [L,QSA]
RewriteRule ^$baseUrl/people/(consolidate)$ $baseUrl/people/$1/ [R]
RewriteRule ^$baseUrl/people/(consolidate)/([^/]+)/ $baseUrl/index.html?action=$1&item=$2 [L,QSA]
RewriteRule ^$baseUrl/people/(consolidate)/([^/]+)$ $baseUrl/people/$1/$2/ [R]
# Editing (non-generic)
RewriteRule ^$baseUrl/(bookings)/(draft|alldrafts).html $baseUrl/index.html?action=$1&do=$2 [L,QSA]
RewriteRule ^$baseUrl/(bookings)/(request).html $baseUrl/index.html?action=$1&do=$2 [L,QSA]
# Generic CRUD operations on most data structure types, though main objects have the timetable listing for the List view
RewriteRule ^$baseUrl/(bookings|eventtypes|editors|buildings|terms|specialdates|roomunavailability|activities|people|rooms)/$ $baseUrl/index.html?action=$1&do=list [L,QSA]
RewriteRule ^$baseUrl/(bookings)/\1.(csv)$ $baseUrl/index.html?action=$1&do=list&exportall=$2 [L,QSA]
RewriteRule ^$baseUrl/(bookings|eventtypes|editors|buildings|terms|specialdates|roomunavailability|activities|people|rooms)$ $baseUrl/$1/ [R]
RewriteRule ^$baseUrl/(people)/all.html$ $baseUrl/index.html?action=$1&do=list&mode=all [L,QSA]
RewriteRule ^$baseUrl/(bookings|eventtypes|editors|buildings|terms|specialdates|roomunavailability|activities|people|rooms)/(add|search)\.html$ $baseUrl/index.html?action=$1&do=$2 [L,QSA]
#!# Not clear this exportall is actually in use
RewriteRule ^$baseUrl/(bookings|eventtypes|editors|buildings|terms|specialdates|roomunavailability|activities|people|rooms)/(search)\.(csv)$ $baseUrl/index.html?action=$1&do=$2exportall=$3 [L,QSA]
RewriteRule ^$baseUrl/(bookings|eventtypes|editors|buildings|terms|specialdates|roomunavailability|activities|people|rooms)/([^/]+)/(|timetable.ics|export.html|timetable.csv)$ $baseUrl/index.html?action=$1&id=$2&do=view&export=$3 [L,QSA]
RewriteRule ^$baseUrl/(bookings|eventtypes|editors|buildings|terms|specialdates|roomunavailability|activities|people|rooms)/([^/]+)$ $baseUrl/$1/$2/ [R]
RewriteRule ^$baseUrl/(bookings|eventtypes|editors|buildings|terms|specialdates|roomunavailability|activities|people|rooms)/([^/]+)/(delete|edit|clone).html$ $baseUrl/index.html?action=$1&id=$2&do=$3 [L,QSA]
RewriteRule ^$baseUrl/(bookings)/([-,0-9]*[0-9])/$ $baseUrl/index.html?action=$1&id=$2&do=view [L,QSA]
RewriteRule ^$baseUrl/(bookings)/([-,0-9]*[0-9])$ $baseUrl/$1/$2/ [R]
# People view
# Lecture capture
RewriteRule ^$baseUrl/(lecturecapture)\.html$ $baseUrl/index.html?action=$1 [L,QSA]
RewriteRule ^$baseUrl/(lecturecapture)\.xml$ $baseUrl/index.html?action=$1xml [L,QSA]
# Other pages
RewriteRule ^$baseUrl/(more|maintenance|clone|teachingloads)\.html$ $baseUrl/index.html?action=$1 [L,QSA]
# Disable all kinds of access restriction on export files (as calendars cannot do Raven authentication)
<LocationMatch "\.ics$">
Require all granted
</LocationMatch>
<LocationMatch "\.(ics|csv|xml)$">
php_value auto_prepend_file none
php_value auto_append_file none
</LocationMatch>
<LocationMatch "\.(ics|csv|xml)$">
php_value memory_limit 250M
</LocationMatch>
# Screen display
<Location $baseUrl/today>
php_value auto_prepend_file none
php_value auto_append_file none
</Location>
</Macro>