4 <Files "firmware_builds">
6 ExpiresDefault "access plus 1 day"
9 #rewrite details GET parameter
10 RewriteCond %{QUERY_STRING} ^app=([^&]+)
11 RewriteCond %{DOCUMENT_ROOT}/api/v1/details-data/%1.json -f
12 RewriteRule ^api/v1/details /api/v1/details-data/%1.json? [END]
14 # details for unknown apps. Also see .htaccess in the dummy dir
15 RewriteRule ^api/v1/details /api/v1/details-dummy/404? [END]
17 RewriteRule ^api/v1/apps/(.*)/download$ /api/v1/apps/$1-download.json? [END]
18 RewriteRule ^api/v1/apps/(.*)$ /api/v1/apps/$1.json? [END]
20 #rewrite developer products "only" GET parameter
21 RewriteCond %{QUERY_STRING} &only=([^&]+)
22 RewriteCond %{DOCUMENT_ROOT}/api/v1/developers/$1/products/%1.json -f
23 RewriteRule ^api/v1/developers/(.+)/products/ /api/v1/developers/$1/products/%1.json? [END]
25 RewriteRule ^api/v1/discover/?$ /api/v1/discover-data/discover.json [END]
26 RewriteRule ^api/v1/discover/(.+)$ /api/v1/discover-data/$1.json [END]
28 #if directoryslash is on, gamers gets redirected to gamers/ (dir index)
29 # the ouya registration does not support redirects there
30 #TODO: Use that only for the api/v1/gamers path, not for all
31 ErrorDocument 400 /api/v1/gamers/register-error.json
32 RewriteRule ^api/v1/gamers$ /api/v1/gamers/register-error.json [R=400,END]
34 #prevent redirect from gamers/me to gamers/me/
39 #Disable the next two lines to have static usernames only
40 RewriteRule ^api/v1/gamers/me$ /api/v1/gamers/me.php [END]
41 RewriteRule ^api/v1/sessions$ /api/v1/sessions.php [END]
43 RewriteRule ^api/v1/gamers/me$ /api/v1/gamers/me.json [END]
45 #purchased games/products
47 RewriteCond %{REQUEST_METHOD} POST
48 RewriteRule ^api/v1/games/(.+)/purchases?$ /api/v1/games/purchase.php [END]
50 RewriteCond %{REQUEST_FILENAME} !-f
51 RewriteRule ^api/v1/games/(.+)/purchases?$ /api/v1/games/purchases-empty.json [END]
54 # q is first parameter
55 RewriteCond %{QUERY_STRING} ^q=([^&]+)
56 RewriteCond %{DOCUMENT_ROOT}/api/v1/search-data/%1.json -f
57 RewriteRule ^api/v1/search /api/v1/search-data/%1.json? [END]
58 # q is not the 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]
63 # for http://clients3.google.com/generate_204
64 RewriteRule ^generate_204$ /api/v1/status
66 #this one wants a 204 status code
67 RewriteRule ^api/v1/status$ - [R=204,L]
69 #push-to-my-ouya needs php scripting support
70 RewriteRule ^api/v1/queued_downloads?$ /api/v1/queued_downloads.php [END]
72 RewriteCond %{REQUEST_METHOD} DELETE
73 RewriteRule ^api/v1/queued_downloads/(.+)?$ /api/v1/queued_downloads_delete.php?game=$1 [END]