Repository navigation
Expand file tree
/
Copy path.htaccess
More file actions
47 lines (44 loc) · 1.61 KB
/
Copy path.htaccess
File metadata and controls
47 lines (44 loc) · 1.61 KB
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
# Chrome Private Prefetch Proxy: allow prefetch of public course pages
# (must be application/trafficadvice+json, not application/json).
<Files "traffic-advice">
<IfModule mod_mime.c>
ForceType application/trafficadvice+json
</IfModule>
<IfModule mod_headers.c>
Header set Cache-Control "public, max-age=86400"
</IfModule>
</Files>
#
# Depending on your Apache web server, you may some tweaks
#
# If you go to a /lessons url and see the /lessons.json data
# Turn off MultiView in your Apache Configuration or add this line:
#
# Options -MultiView
#
# Some web servers need a RewriteBase after "RewriteEngine on" below
# It will need to be the path on this web server for this
# folder. So far I only needed this on 1and1. Here are two examples:
#
# RewriteBase /
# RewriteBase /py4e
#
<IfModule mod_rewrite.c>
RewriteEngine on
# Old interactive-book URLs go to the book page.
RewriteRule ^trinket3?(/.*)?$ /book.php [R=301,L,NC]
# config.php stubs / secrets; FileRouter also maps /config and /config-dist
RewriteRule ^config(-dist)?(\.php)?(/.*)?$ - [R=404,L,NS]
# Include-only fragments (need Tsugi $OUTPUT / $CFG; not standalone pages)
RewriteRule ^(nav|top|footer|buildmenu|sanity|tsugi_settings)\.php$ - [R=404,L,NS]
# Route /labs to Tsugi (must precede the !-d rule)
RewriteRule ^labs/?$ tsugi.php [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ tsugi.php [L]
RedirectMatch 404 /\.git
</IfModule>
<IfModule !mod_rewrite.c>
FallbackResource tsugi.php
</IfModule>