forked from scummvm/scummvm-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
133 lines (113 loc) · 6.88 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# Enable mod_rewrite
RewriteEngine On
# Set the base for the rewritten URLs
# NOTE: When debugging locally, set this to the directory the site is in
RewriteBase /
# Fetch language and put it into Cookie
RewriteCond %{QUERY_STRING} lang=(.*)?
RewriteRule .* - [CO=lang:%1:.scummvm.org:86400]
RewriteRule ^old/.* - [L]
# Cloud service provider redirects
# Dropbox
RewriteRule ^c/db$ https://www.dropbox.com/1/oauth2/authorize?response_type=code&redirect_uri=https://www.scummvm.org/c/code&client_id=dlm3nadaa4t3nsk [NE]
RewriteRule ^c/dbs$ https://www.dropbox.com/1/oauth2/authorize?response_type=code&redirect_uri=http://localhost:12345/&client_id=dlm3nadaa4t3nsk [NE]
# OneDrive
RewriteRule ^c/od$ https://login.live.com/oauth20_authorize.srf?response_type=code&redirect_uri=https://www.scummvm.org/c/code&client_id=c9582384-aa02-4054-bc40-56692270cb02&scope=onedrive.appfolder+offline_access
RewriteRule ^c/ods$ https://login.live.com/oauth20_authorize.srf?response_type=code&redirect_uri=http://localhost:12345/&client_id=c9582384-aa02-4054-bc40-56692270cb02&scope=onedrive.appfolder+offline_access
# Google Drive
RewriteRule ^c/gd$ https://accounts.google.com/o/oauth2/auth?response_type=code&redirect_uri=https://www.scummvm.org/c/code&client_id=372269489234-cc487pr03275ua50b6sr7tulq3d6dfbi.apps.googleusercontent.com&scope=https://www.googleapis.com/auth/drive
RewriteRule ^c/gds$ https://accounts.google.com/o/oauth2/auth?response_type=code&redirect_uri=http://localhost:12345&client_id=372269489234-cc487pr03275ua50b6sr7tulq3d6dfbi.apps.googleusercontent.com&scope=https://www.googleapis.com/auth/drive
# Box
RewriteRule ^c/bx$ https://account.box.com/api/oauth2/authorize?response_type=code&client_id=93trp4qdtmrbb5mccdofdnplhizcv2mi&redirect_uri=https://www.scummvm.org/c/code
RewriteRule ^c/bxs$ https://account.box.com/api/oauth2/authorize?response_type=code&client_id=93trp4qdtmrbb5mccdofdnplhizcv2mi&redirect_uri=http://localhost:12345
RewriteRule ^c/.* c/index.php [L]
##
# We moved screenshots, fixing the links
##
RewriteRule ^screenshots/(scummvm_[0-9]+.png)$ data/screenshots/old/$1 [L]
RewriteRule ^screenshots/(big_scummvm_[0-9]+.png)$ data/screenshots/old/$1 [L]
RewriteRule ^screenshots/(scummvm_[0-9]+.jpg)$ data/screenshots/old/$1 [L]
RewriteRule ^(?:data/)?screenshots/other/(sword/.*)$ data/screenshots/revolution/$1 [L]
RewriteRule ^(?:data/)?screenshots/other/(sky/.*)$ data/screenshots/revolution/$1 [L]
RewriteRule ^(?:data/)?screenshots/other/(lure/.*)$ data/screenshots/revolution/$1 [L]
RewriteRule ^(?:data/)?screenshots/other/(simon/.*)$ data/screenshots/agos/$1 [L]
RewriteRule ^(?:data/)?screenshots/other/(feeble/.*)$ data/screenshots/agos/$1 [L]
RewriteRule ^(?:data/)?screenshots/other/(kyra/.*)$ data/screenshots/westwood/$1 [L]
RewriteRule ^(?:data/)?screenshots/other/(gob/.*)$ data/screenshots/gob/$1 [L]
RewriteRule ^(?:data/)?screenshots/other/(bargon/.*)$ data/screenshots/gob/$1 [L]
RewriteRule ^screenshots/(scummvm_0_0_5.jpg)$ data/screenshots/lec/maniac/$1 [L]
RewriteRule ^screenshots/big(scummvm_0_0_0).png$ data/screenshots/lec/maniac/$1-full.png [L]
RewriteRule ^screenshots/(scummvm_0_2_2.jpg)$ data/screenshots/lec/indy3/$1 [L]
RewriteRule ^screenshots/(scummvm_0_3_[01].jpg)$ data/screenshots/lec/atlantis/$1 [L]
RewriteRule ^screenshots/big(scummvm_0_3_[01]).png$ data/screenshots/lec/atlantis/$1-full.png [L]
RewriteRule ^screenshots/(scummvm_0_4_[7-9].jpg)$ data/screenshots/lec/monkey/$1 [L]
RewriteRule ^screenshots/big(scummvm_0_4_[56]).png$ data/screenshots/lec/monkey/$1-full.png [L]
RewriteRule ^screenshots/(scummvm_0_5_[0-2].jpg)$ data/screenshots/lec/monkey2/$1 [L]
RewriteRule ^screenshots/(scummvm_0_6_[0-4].jpg)$ data/screenshots/lec/loom/$1 [L]
RewriteRule ^screenshots/big(scummvm_0_6_[0-4]).png$ data/screenshots/lec/loom/$1-full.png [L]
RewriteRule ^screenshots/(scummvm_0_7_[01].jpg)$ data/screenshots/lec/samnmax/$1 [L]
RewriteRule ^screenshots/big(scummvm_0_7_0).png$ data/screenshots/lec/samnmax/$1-full.png [L]
RewriteRule ^screenshots/(scummvm_0_8_[01].jpg)$ data/screenshots/lec/tentacle/$1 [L]
RewriteRule ^screenshots/big(scummvm_0_8_[01]).png$ data/screenshots/lec/tentacle/$1-full.png [L]
RewriteRule ^screenshots/(scummvm_0_9_[0-2].jpg)$ data/screenshots/lec/ft/$1 [L]
RewriteRule ^screenshots/big(scummvm_0_9_[0-2]).png$ data/screenshots/lec/ft/$1-full.png [L]
RewriteRule ^screenshots/(scummvm_0_10_0.jpg)$ data/screenshots/lec/dig/$1 [L]
RewriteRule ^screenshots/(scummvm_0_11_[0-2].jpg)$ data/screenshots/lec/comi/$1 [L]
RewriteRule ^screenshots/big(scummvm_0_11_[0-2]).png$ data/screenshots/lec/comi/$1-full.png [L]
RewriteRule ^screenshots/(scummvm_2_0_[03].jpg)$ data/screenshots/revolution/sword/$1 [L]
RewriteRule ^screenshots/(scummvm_2_3_[01].jpg)$ data/screenshots/other/queen/$1 [L]
RewriteRule ^screenshots/(scummvm_2_5_[01].jpg)$ data/screenshots/revolution/sky/$1 [L]
RewriteRule ^screenshots/(scummvm_2_6_1.jpg)$ data/screenshots/westwood/kyra/kyra1-2.jpg [L]
##
# Images linked directly from the wiki need to work
##
RewriteRule ^screenshots/(.+)\.(jpg|png)$ data/screenshots/$1.$2 [NS,L]
##
# Standard location for appcast
##
RewriteRule ^scummvm_appcast.xml appcasts/macosx/release.xml [L]
##
# Catch script kiddies
##
RewriteRule wp-(admin|login) / [R=301]
##
# Forward old page requests to the new fancy URLs
##
# Compatibility page, with args
RewriteCond %{QUERY_STRING} version=(DEV|[0-9\.rc]+)(&details=(.+))?
RewriteRule ^compatibility\.php$ compatibility/%1/%3/? [NS,R=301]
# Documentation page, with args
RewriteCond %{QUERY_STRING} view=md5
RewriteRule ^documentation\.php$ documentation/md5sums/? [NS,R=301]
# News page, with args
RewriteCond %{QUERY_STRING} shownews=([0-9]{8}).xml [OR]
RewriteCond %{QUERY_STRING} shownews=(archive)
RewriteRule ^(index\.php)?$ news/%1/? [NS,R=301]
# Feeds (not pretty)
RewriteRule ^feed-(atom|rss)(20)?.php$ feeds/$1/? [NS,R=301]
# Other pages, without args
RewriteRule ^(.+)\.php$ $1/? [NS,R=301]
##
# Basic rewrite
##
RewriteRule ^([a-z]+)/?$ ?p=$1 [QSA]
##
# Compatibility
##
RewriteRule ^(compatibility)(/(DEV|[0-9\.rc]+)(/([^/]+))?)?/?$ ?p=$1&v=$3&t=$5 [L,QSA]
##
# Documentation
##
RewriteRule ^(documentation)(/([^/]+))?/? ?p=$1&d=$3 [L,QSA]
##
# Feeds
##
RewriteRule ^(feeds)/(atom|rss)/? ?p=$1&f=$2 [L,QSA]
##
# News
##
RewriteRule ^(news)(/([0-9]{8}[a-z]?|archive))?/?$ ?p=$1&d=$3 [L,QSA]
##
# Screenshots
##
RewriteRule ^(screenshots)(/([a-z]+)(/([-_a-z0-9]+)(/([0-9]+))?)?)?/? ?p=$1&cat=$3&game=$5&num=$7 [L,QSA]