1- RewriteEngine On
2-
3- #Legacy Rewrites
4- RewriteCond %{QUERY_STRING} ^id=(.*)$ [NC]
5- RewriteRule ^schedule.php$ /schedule/%1? [NC,L,R=302 ]
6-
7-
8- # Let old ScheduleMaker handle Resig's schedules for now
9- #RewriteCond %{QUERY_STRING} ^mode=old&id=(.*)$ [NC]
10- RewriteRule ^schedule.php$ http://schedule-old.csh.rit.edu/schedule.php [NC,L,R=302 ]
11-
12- RewriteCond %{HTTP:Accept} application/json [NC]
13- RewriteRule ^(schedule|generate|entity|search|status|rmp)(?:/([^/]*))*$ api/$1.php [L]
14- RewriteRule ^schedule/[^/]*/ical$ api/schedule.php [L]
15-
16-
17- # Don't rewrite files or directories
18- RewriteCond %{REQUEST_FILENAME} -f [OR]
19- RewriteCond %{REQUEST_FILENAME} -d
20- RewriteRule ^ - [L]
21-
22-
23- # Rewrite everything else to index.html to allow html5 state links
24- RewriteRule ^ index.php [L]
1+ # COMPRESSION
2+ <IfModule mod_deflate.c >
3+ AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript application/json
4+ </IfModule >
5+
6+ # REWRITES
7+ <IfModule mod_rewrite.c >
8+ RewriteEngine On
9+
10+ # Let the old ScheduleMaker handle Resig's schedules for now
11+ #RewriteCond %{QUERY_STRING} ^mode=old&id=(.*)$ [NC]
12+ RewriteRule ^schedule.php$ http://schedule-old.csh.rit.edu/schedule.php [NC,L,R=302 ]
13+
14+ # Legacy Rewrites from previous version
15+ RewriteCond %{QUERY_STRING} ^id=(.*)$ [NC]
16+ RewriteRule ^schedule.php$ /schedule/%1? [NC,L,R=302 ]
17+ RewriteRule ^(generate|roulette|search|status).php$ /$1 [R=302 ,L]
18+
19+ # Rewrite any request that wants json to the api directory
20+ RewriteCond %{HTTP:Accept} application/json [NC]
21+ RewriteRule ^(schedule|generate|entity|search|status|rmp)(?:/([^/]*))*$ api/$1.php [L]
22+ RewriteRule ^schedule/[^/]*/ical$ api/schedule.php [L]
23+
24+ # Don't rewrite files or directories
25+ RewriteCond %{REQUEST_FILENAME} -f [OR]
26+ RewriteCond %{REQUEST_FILENAME} -d
27+ RewriteRule ^ - [L]
28+
29+ # Rewrite everything else to index.html to allow html5 state links
30+ RewriteRule ^ index.php [L]
31+ </IfModule >
32+
33+ # CACHING
34+
35+ # Set max-age one year in the future for all static assets
36+ <IfModule mod_headers.c >
37+ # Allow caching for all assets
38+ <FilesMatch "(.*)\.(js|css|png|jpg|html)$" >
39+ Header set Cache-Control "max-age=29030400 , public"
40+ Header unset ETag
41+ FileETag None
42+ </FilesMatch >
43+ </IfModule >
44+
45+ # Cache Everything, set their expiration date one year in the future
46+ <IfModule mod_expires.c >
47+ ExpiresActive On
48+ ExpiresDefault A300
49+ ExpiresByType image/x-icon A29030400
50+ ExpiresByType application/javascript A29030400
51+ ExpiresByType text/css A29030400
52+ ExpiresByType image/gif A29030400
53+ ExpiresByType image/png A29030400
54+ ExpiresByType image/jpeg A29030400
55+ ExpiresByType text/plain A29030400
56+ ExpiresByType text/html A29030400
57+ </IfModule >
0 commit comments