-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
executable file
·54 lines (42 loc) · 1.73 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
<IfModule mod_mime.c>
AddType text/plain .2
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# If the filename's not found, try adding .php
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^(.+)$ $1.php [QSA,L]
# look in /data for .csv files if they're not found.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)\.csv$ data/$1.csv [NC,L]
# foo-transactions.html really lives in /data
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+\-transactions\.html)$ data/$1 [NC,L]
# foo/transactions -> data/foo-transactions.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/transactions/?$ data/$1-transactions.html [NC,L]
# foo/fullscreen -> padm.us/yl-foo?fullScreen=1
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/fullscreen/?$ http://insecure.padm.us/yl-$1?fullScreen=1 [NC,L]
# problem with extra trailing slashes; this seems to solve it.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/+$ $1 [R]
# If yootles.com/foo doesn't exist, do yootles.com/ledger.php?ledger=foo
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/\.]+)/*$ ledger.php?ledg=$1 [NC,L]
# Old url scheme for ledgers, yootles.com/ledger/foo to yootles.com/foo
# Probably safe to drop this by now since it probably last mattered in 2006
RewriteRule ^ledger/(.*)/*$ $1 [R,NC,L]
# yootles.com/foo/alice -> yootles.com/data/foo-alice.txt
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/\.]+)/([^/\.]+)/?$ data/$1-$2.txt [NC,L]
</IfModule>