Fix charset for "One Tap Hero"
[stouyapi.git] / www / .htaccess
1 #no iso-2022-cn charset for "com.cis.ouya.oth.htm"
2 #"RemoveCharset" does not work, so we have to override with AddCharset
3 AddCharset UTF-8 .iso2022-cn .cis
4
5 RewriteEngine on
6 RewriteBase /
7
8 <Files "firmware_builds">
9     ExpiresActive On
10     ExpiresDefault "access plus 1 day"
11 </Files>
12
13 #rewrite details GET parameter
14 RewriteCond %{QUERY_STRING} ^app=([^&]+)
15 RewriteCond %{DOCUMENT_ROOT}/api/v1/details-data/%1.json -f
16 RewriteRule ^api/v1/details /api/v1/details-data/%1.json? [END]
17
18 # details for unknown apps. Also see .htaccess in the dummy dir
19 RewriteRule ^api/v1/details /api/v1/details-dummy/404? [END]
20
21 RewriteRule ^api/v1/apps/(.*)/download$ /api/v1/apps/$1-download.json? [END]
22 RewriteRule ^api/v1/apps/(.*)$ /api/v1/apps/$1.json? [END]
23
24 #rewrite developer products "only" GET parameter
25 RewriteCond %{QUERY_STRING} &only=([^&]+)
26 RewriteCond %{DOCUMENT_ROOT}/api/v1/developers/$1/products/%1.json -f
27 RewriteRule ^api/v1/developers/(.+)/products/ /api/v1/developers/$1/products/%1.json? [END]
28
29 RewriteRule ^api/v1/discover/?$ /api/v1/discover-data/discover.json [END]
30 RewriteRule ^api/v1/discover/(.+)$ /api/v1/discover-data/$1.json [END]
31
32 #if directoryslash is on, gamers gets redirected to gamers/ (dir index)
33 # the ouya registration does not support redirects there
34 #TODO: Use that only for the api/v1/gamers path, not for all
35 ErrorDocument 400 /api/v1/gamers/register-error.json
36 RewriteRule ^api/v1/gamers$ /api/v1/gamers/register-error.json [R=400,END]
37
38 #prevent redirect from gamers/me to gamers/me/
39 <Files "me">
40     DirectorySlash Off
41 </Files>
42
43 #Disable the next two lines to have static usernames only
44 RewriteRule ^api/v1/gamers/me$ /api/v1/gamers/me.php [END]
45 RewriteRule ^api/v1/sessions$ /api/v1/sessions.php [END]
46
47 RewriteRule ^api/v1/gamers/me$ /api/v1/gamers/me.json [END]
48
49 #purchased games/products
50 # active buy requests
51 RewriteCond %{REQUEST_METHOD} POST
52 RewriteRule ^api/v1/games/(.+)/purchases?$ /api/v1/games/purchase.php [END]
53
54 RewriteCond %{REQUEST_FILENAME} !-f
55 RewriteRule ^api/v1/games/(.+)/purchases?$ /api/v1/games/purchases-empty.json [END]
56
57 #search
58 # q is first parameter
59 RewriteCond %{QUERY_STRING} ^q=([^&]+)
60 RewriteCond %{DOCUMENT_ROOT}/api/v1/search-data/%1.json -f
61 RewriteRule ^api/v1/search /api/v1/search-data/%1.json? [END]
62 # q is not the first parameter
63 RewriteCond %{QUERY_STRING} &q=([^&]+)
64 RewriteCond %{DOCUMENT_ROOT}/api/v1/search-data/%1.json -f
65 RewriteRule ^api/v1/search /api/v1/search-data/%1.json? [END]
66
67 # for http://clients3.google.com/generate_204
68 RewriteRule ^generate_204$ /api/v1/status
69
70 #this one wants a 204 status code
71 RewriteRule ^api/v1/status$ - [R=204,L]
72
73 #push-to-my-ouya needs php scripting support
74 RewriteRule ^api/v1/queued_downloads?$ /api/v1/queued_downloads.php [END]
75
76 RewriteCond %{REQUEST_METHOD} DELETE
77 RewriteRule ^api/v1/queued_downloads/(.+)?$ /api/v1/queued_downloads_delete.php?game=$1 [END]