-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdefault
360 lines (315 loc) · 23.7 KB
/
default
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
# vim: ft=apache ts=4 sw=4 sts=4 sr et:
<VirtualHost *:80>
ServerName MAGICALPONY.legal.creativecommons.org
VirtualDocumentRoot /srv/clones/MAGICALPONY/docroot
DocumentRoot /srv/clones/MAGICALPONY/docroot
RewriteEngine on
#----------
# Logging. Uncomment these lines and adjust the log level for debugging. Make
# sure to recomment them and restart Apache when done because the file will
# become immense in a hurry.
#----------
#RewriteLog /tmp/rewrite.log
#RewriteLogLevel 5
#----------
# Config
#----------
RewriteMap uppercase int:toupper
#----------
# License engine and legalcode
#----------
Alias /ccengine-fcgi /srv/creativecommons.org/python_env/bin/ccengine.fcgi
Alias /cc.engine-cache /srv/creativecommons.org/python_env/cache
# Redirect all /license to /choose before we go any deeper
RewriteRule ^/choose$ %{SERVER_PROTOCOL}://%{HTTP_HOST}/choose/ [L,R=301]
RewriteRule ^/license$ %{SERVER_PROTOCOL}://%{HTTP_HOST}/choose/ [L,R=301]
# Fixes this repercussions of this bug:
# http://code.creativecommons.org/issues/issue898
RewriteRule ^/licenses/CC0/1.0(.*)$ /publicdomain/zero/1.0$1 [L,R=301]
# Legalcode rewrites
# FIXME: eval whether we should use the LHS as the actual file structure so we don't need the rewrites
RewriteRule ^/legalcode %{SERVER_PROTOCOL}://%{HTTP_HOST}/ [L,R=301]
RewriteRule .*legalcode/$ %{SERVER_PROTOCOL}://%{HTTP_HOST}/ [L,R=301]
RewriteRule ^/licenses/(.*)sampling\+/1.0/(.*)/legalcode$ /legalcode/$1samplingplus_1.0_$2.html [L]
RewriteRule ^/licenses/(.*)sampling\+/1.0/legalcode$ /legalcode/$1samplingplus_1.0.html [L]
RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/(.*)/legalcode\.([a-zA-Z_-]+)$ /legalcode/$1_$2_$3_$4.html [L]
RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/legalcode\.([a-zA-Z_-]+)$ /legalcode/$1_$2_$3.html [L]
RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/(.*)/legalcode$ /legalcode/$1_$2_$3.html [L]
RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/legalcode$ /legalcode/$1_$2.html [L]
RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/legalcode\.txt$ /legalcode/$1_$2.txt [L]
RewriteRule ^/publicdomain/(.*)/([0-9]\.[0-9])/legalcode$ /legalcode/$1_$2.html [L]
# -Aaa is for Chinese
RewriteRule ^/publicdomain/(.*)/([0-9]\.[0-9])/legalcode\.([a-z][a-z](-[A-Z][a-z][a-z][a-z])?)$ /legalcode/$1_$2_$3.html [L]
RewriteRule ^/publicdomain/(.*)/([0-9]\.[0-9])/legalcode\.txt$ /legalcode/$1_$2.txt [L]
# License RDF rewrites
# FIXME: eval whether we should use the LHS as the actual file structure so we don't need the rewrites
RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/([a-z]+)/license_rdf$ /license_rdf/creativecommons.org_licenses_$1_$2_$3_.rdf [L,T=application/rdf+xml]
RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/([a-z]+)/rdf$ /license_rdf/creativecommons.org_licenses_$1_$2_$3_.rdf [L,T=application/rdf+xml]
RewriteRule ^/licenses/index.rdf$ /rdf/index.rdf [L,T=application/rdf+xml]
RewriteRule ^/licenses/publicdomain/license_rdf$ /license_rdf/creativecommons.org_licenses_publicdomain_.rdf [L,T=application/rdf+xml]
RewriteRule ^/licenses/publicdomain/rdf$ /license_rdf/creativecommons.org_licenses_publicdomain_.rdf [L,T=application/rdf+xml]
RewriteRule ^/(publicdomain|licenses)/(.*)/([0-9]\.[0-9])/license_rdf$ /license_rdf/creativecommons.org_$1_$2_$3_.rdf [L,T=application/rdf+xml]
RewriteRule ^/(publicdomain|licenses)/(.*)/([0-9]\.[0-9])/rdf$ /license_rdf/creativecommons.org_$1_$2_$3_.rdf [L,T=application/rdf+xml]
RewriteRule .*rdf/$ %{SERVER_PROTOCOL}://%{HTTP_HOST}/ [L,R=301]
# See if deed is cached before sending to cc.engine
# FIXME: eval memcache as an alternative?
RewriteCond %{REQUEST_URI} ^/licenses
RewriteCond /srv/clones/MAGICALPONY/python_env/cache/%{REQUEST_FILENAME} -s
RewriteRule ^/licenses/(.*) /cc.engine-cache/licenses/$1 [L,PT]
# FIXME: do we really need rewrites for other licenses like GPL, etc?
RewriteRule (.*)licence(.*) %{SERVER_PROTOCOL}://%{HTTP_HOST}$1license$2 [L,R=301]
RewriteRule ^/(license|choose|characteristic|publicdomain)$ /$1/ [L,R=301]
RewriteRule ^/(license|choose|characteristic|publicdomain)/(.*) /ccengine-fcgi/$1/$2 [PT,L]
RewriteRule ^/licenses$ %{SERVER_PROTOCOL}://%{HTTP_HOST}/licenses/ [L,R=301]
RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/([a-z][a-z])$ %{SERVER_PROTOCOL}://%{HTTP_HOST}/licenses/$1/$2/$3/ [L,R=301]
RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/([Ss]cotland)$ %{SERVER_PROTOCOL}://%{HTTP_HOST}/licenses/$1/$2/scotland/ [L,R=301]
RewriteRule ^/licenses/(.*)([0-9])$ %{SERVER_PROTOCOL}://%{HTTP_HOST}/licenses/$1$2/ [L,R=301]
RewriteRule ^/licenses/(.*)/2.0/ar/(.*)$ %{SERVER_PROTOCOL}://%{HTTP_HOST}/licenses/$1/2.5/ar/$2 [L,R=301]
RewriteRule ^/licenses/BSD/legalcode http://opensource.org/licenses/bsd-license.php [L,R]
RewriteRule ^/licenses/by-nc-nd/2.0/deed-music$ %{SERVER_PROTOCOL}://%{HTTP_HOST}/licenses/by-nc-nd/2.0/ [L,R=301]
RewriteRule ^/licenses/by-nc-nd/1.0/legalcode$ %{SERVER_PROTOCOL}://%{HTTP_HOST}/licenses/by-nd-nc/1.0/legalcode [L,R=301]
RewriteRule ^/licenses/by-nc-nd/1.0/$ %{SERVER_PROTOCOL}://%{HTTP_HOST}/licenses/by-nd-nc/1.0/ [L,R=301]
RewriteRule ^/licenses/nc-nd/1.0/legalcode$ %{SERVER_PROTOCOL}://%{HTTP_HOST}/licenses/nd-nc/1.0/legalcode [L,R=301]
RewriteRule ^/licenses/nc-nd/1.0/$ %{SERVER_PROTOCOL}://%{HTTP_HOST}/licenses/nd-nc/1.0/ [L,R=301]
RewriteRule ^/licenses/(.*)/deed.(.*)/$ %{SERVER_PROTOCOL}://%{HTTP_HOST}/ [L,R=301]
RewriteRule ^/licenses/eldred-pd/$ http://web.archive.org/web/20030115160926/http://www.creativecommons.org/licenses/eldred-pd [L,R=301]
RewriteRule ^/licenses/GPL/2.0/rdf$ http://www.gnu.org/licenses/gpl-2.0.rdf [R=301,L]
RewriteRule ^/licenses/LGPL/2.1/rdf$ http://www.gnu.org/licenses/lgpl-2.1.rdf [R=301,L]
RewriteRule ^/licenses/meet-the-licenses$ %{SERVER_PROTOCOL}://%{HTTP_HOST}/licenses/ [L,R=301]
RewriteRule ^/licenses/MIT/legalcode http://opensource.org/licenses/mit-license.php [L,R]
RewriteRule ^/licenses/publicdomain/1.0(.*)$ %{SERVER_PROTOCOL}://%{HTTP_HOST}/licenses/publicdomain/ [L,R=301]
RewriteRule ^/licenses/zero/1.0/(.*) /publicdomain/zero/1.0/$1 [L,R=301]
RewriteRule ^/licesne(.*)$ %{SERVER_PROTOCOL}://%{HTTP_HOST}/choose$1 [L,R=301]
RewriteRule ^/public_domain %{SERVER_PROTOCOL}://%{HTTP_HOST}/publicdomain/ [R=301,L]
RewriteRule ^/licenses/(.*) /ccengine-fcgi/licenses/$1 [PT,L]
#----------
# Old content/URLs going to new places
#----------
RewriteRule ^/200.* %{SERVER_PROTOCOL}://%{SERVER_NAME}/ [L,R=301]
RewriteRule ^/aboutus %{SERVER_PROTOCOL}://%{SERVER_NAME}/about [L,R=301]
RewriteRule ^/about/ccvideo %{SERVER_PROTOCOL}://%{SERVER_NAME}/videos/ [L,R=301]
RewriteRule ^/about/license$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/licenses/ [L,R=301]
RewriteRule ^/about/licenses/?$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/licenses/ [L,R=301]
RewriteRule ^/about/licenses/meet-the-licenses/?$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/licenses/ [L,R=301]
RewriteRule /about/licenses/sampling %{SERVER_PROTOCOL}://%{SERVER_NAME}/about/licenses/ [L,R=301]
Rewriterule ^/about/people/alumni http://web.archive.org/*/http://creativecommons.org/about/people [L,R=301]
Rewriterule ^/about/people/?$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/staff [L,R=301]
Rewriterule ^/about/people/board/?$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/board [L,R=301]
Rewriterule ^/about/people/fellows/?$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/fellows [L,R=301]
Rewriterule ^/about/opportunities/?$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/opportunities [L,R=301]
RewriteRule /about/sampling %{SERVER_PROTOCOL}://%{SERVER_NAME}/retiredlicenses [L,R=301]
RewriteRule /about/sampling-movie %{SERVER_PROTOCOL}://%{SERVER_NAME}/about/licenses/ [L,R=301]
RewriteRule ^/about/videos$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/videos/ [L,R=301]
RewriteRule ^/about/what-is-cc/?$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/about [L,R=301]
RewriteRule ^/about/who-uses-cc/?$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/who-uses-cc [L,R=301]
RewriteRule .*/archive/archive.* %{SERVER_PROTOCOL}://%{SERVER_NAME}/ [L,R=301]
RewriteRule ^/asharedculture/?$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/videos/a-shared-culture [L,R=301]
RewriteRule ^/audio/([-a-z0-9]+)/?$ /index.php?category_name=audio&name=$1 [QSA,L]
RewriteRule .*/author$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/ [L,R=301]
RewriteRule ^/choose/devnations$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/retiredlicenses [L,R=301]
RewriteRule ^/commoners(.*)?$ /interviews$1 [L,R]
RewriteRule ^/concepts/examples$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/licenses/ [L,R=301]
RewriteRule ^/concepts/(.*)$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/licenses/ [L,R=301]
RewriteRule ^/counter.* %{SERVER_PROTOCOL}://%{SERVER_NAME}/ [L,R=301]
RewriteRule ^(.*)CVS.*$ $1 [L,R=301]
RewriteRule ^/discuss/?$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/contact#discuss [L,NE,R=301]
RewriteRule ^/draft/(.*)$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/licenses/ [L,R=301]
RewriteRule /drafts/wiki_0.5$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/licenses/by-sa/2.5/ [L,R=301]
RewriteRule ^/education/([-a-z0-9]+)/?$ /index.php?category_name=education&name=$1 [L,QSA]
RewriteRule ^/_.* %{SERVER_PROTOCOL}://%{SERVER_NAME}/ [L,R=301]
RewriteRule ^/features(.*)$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/licenses/ [L,R=301]
RewriteRule ^/fellows %{SERVER_PROTOCOL}://%{SERVER_NAME}/staff [L,R=301]
RewriteRule ^/find.*$ http://search.creativecommons.org/ [L,R=301]
RewriteRule ^/freeculture.*$ http://lessig.org/freeculture [L,R=301]
RewriteRule ^/getcontent.*$ http://search.creativecommons.org/ [L,R=301]
RewriteRule http %{SERVER_PROTOCOL}://%{SERVER_NAME}/ [L,R=301]
RewriteRule ^/http.* %{SERVER_PROTOCOL}://%{SERVER_NAME}/ [L,R=301]
RewriteRule ^/icon/(.*)$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/icons/$1 [L,R=301]
RewriteRule ^/image/([-a-z0-9]+)/?$ /index.php?category_name=image&name=$1 [QSA,L]
RewriteRule ^/images.*/$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/ [L,R=301]
RewriteRule index_html %{SERVER_PROTOCOL}://%{SERVER_NAME}/ [L,R=301]
RewriteRule ^/interviews/([-a-z0-9]+)/?$ /index.php?category_name=interviews&name=$1 [QSA,L]
RewriteRule /learn/aboutus/$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/about/history [L,R=301]
RewriteRule /learn/aboutus/people$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/about/people [L,R=301]
RewriteRule /learn/artistscorners/educators$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/education [L,R=301]
RewriteRule /taa-grant-program$ http://open4us.org/ [L,R=301]
RewriteRule /learn/artistscorners/$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/ [L,R=301]
RewriteRule /learn/artistscorners/filmmakers$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/video [L,R=301]
RewriteRule /learn/artistscorners/musicians$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/audio [L,R=301]
RewriteRule /learn/artistscorners/photographers$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/image [L,R=301]
RewriteRule /learn/artistscorners/writers$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/text [L,R=301]
RewriteRule ^/learn/features/(.*)$ http://search.creativecommons.org/ [L,R=301]
RewriteRule ^/learn/getcontent$ http://search.creativecommons.org/ [L,R=301]
RewriteRule /learn/legal/$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/licenses/ [L,R=301]
RewriteRule /learn/licenses %{SERVER_PROTOCOL}://%{SERVER_NAME}/licenses/ [L,R=301]
RewriteRule /learn/$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/about [L,R=301]
RewriteRule ^/learnmore/?$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/about [L,R=301]
RewriteRule ^/legal/.*$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/ [L,R=301]
RewriteRule .*/login_form$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/ [L,R=301]
RewriteRule .*/manage.*$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/ [L,R=301]
RewriteRule ^/media-that-matters-video/?$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/videos/media-that-matters [L,R=301]
RewriteRule ^/news/blog/$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/weblog [L,R=301]
RewriteRule ^/news/pressarchive.html$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/weblog [L,R=301]
RewriteRule ^/news/pressarchive$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/weblog [L,R=301]
RewriteRule ^/news/pressreleases %{SERVER_PROTOCOL}://%{SERVER_NAME}/press-releases [L,R=301]
RewriteRule ^/policy$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/policies [L,R=301]
RewriteRule ^/press/.*$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/weblog [L,R=301]
RewriteRule ^/press$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/weblog [L,R=301]
RewriteRule ^/pressarchive$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/weblog [L,R=301]
RewriteRule ^/presskit/(.+)\.([a-z]+)$ http://mirrors.creativecommons.org/presskit/$1.$2 [L,R=301]
RewriteRule ^/presskit %{SERVER_PROTOCOL}://%{SERVER_NAME}/about/press [L,R=301]
RewriteRule /projects/founderscopyright http://wiki.creativecommons.org/Founders_Copyright [L,R=301]
#RewriteRule /\sprojects/founderscopyright http://wiki.creativecommons.org/Founders_Copyright [L,R=301]
RewriteRule /projects/sampling %{SERVER_PROTOCOL}://%{SERVER_NAME}/retiredlicenses [L,R=301]
RewriteRule /support/video$ %{SERVER_PROTOCOL}://%{SERVER_NAME}/videos [L,R=301]
RewriteRule ^/text/([-a-z0-9]+)/?$ /index.php?category_name=text&name=$1 [L,QSA]
RewriteRule ^/video/([-a-z0-9]+)/?$ /index.php?category_name=video&name=$1 [L,QSA]
RewriteRule ^/press-releases/entry/40938 /press-releases/entry/40935 [L,R=301]
RewriteRule ^/weblog/entry/40938 /press-releases/entry/40935 [L,R=301]
RewriteRule ^/weblog/entry/([-a-z0-9]+) /index.php?p=$1 [L,R=301]
#----------
# Farming out old/removed CC.org content to CC Wiki
#----------
RewriteRule ^/about/legal/cultivating http://wiki.creativecommons.org/Cultivating_the_Public_Domain [L,R=301]
RewriteRule ^/about/legal/?$ http://wiki.creativecommons.org/Legal_Concepts [L,R=301]
Rewriterule ^/about/licenses/comics1 http://wiki.creativecommons.org/Spectrumofrights_Comic1 [L,R=301]
Rewriterule ^/about/licenses/comics2 http://wiki.creativecommons.org/Spectrumofrights_Comic2 [L,R=301]
Rewriterule ^/about/licenses/comics3 http://wiki.creativecommons.org/Spectrumofrights_Comic3 [L,R=301]
Rewriterule ^/about/licenses/comics4 http://wiki.creativecommons.org/Spectrumofrights_Comic4 [L,R=301]
Rewriterule ^/about/licenses/examples http://wiki.creativecommons.org/License_Examples [L,R=301]
Rewriterule ^/about/licenses/fullrights http://wiki.creativecommons.org/Baseline_Rights [L,R=301]
Rewriterule ^/about/licenses/how1 http://wiki.creativecommons.org/Howitworks_Comic1 [L,R=301]
Rewriterule ^/about/licenses/how2 http://wiki.creativecommons.org/Howitworks_Comic2 [L,R=301]
Rewriterule ^/about/licenses/how3 http://wiki.creativecommons.org/Howitworks_Comic3 [L,R=301]
Rewriterule ^/about/licenses/how4 http://wiki.creativecommons.org/Howitworks_Comic4 [L,R=301]
RewriteRule ^/about/think/?$ http://wiki.creativecommons.org/Before_Licensing [L,R=301]
RewriteRule ^/audio/publish-internetarchive http://wiki.creativecommons.org/HOWTO_Publish#Internet_Archive [L,NE,R=301]
RewriteRule ^/audio/publish-morpheus http://wiki.creativecommons.org/HOWTO_Publish#Morpheus [L,NE,R=301]
RewriteRule ^/audio/publish-soundclick http://wiki.creativecommons.org/HOWTO_Publish#Soundclick [L,NE,R=301]
RewriteRule ^/audio/publish-website http://wiki.creativecommons.org/HOWTO_Publish#Adding_a_license_to_your_audio_page [L,NE,R=301]
RewriteRule ^/education/publish-website http://wiki.creativecommons.org/HOWTO_Publish#Adding_a_license_to_your_existing_website_2 [L,NE,R=301]
RewriteRule ^.*/embedding$ http://wiki.creativecommons.org/Embedded_Metadata [L,R=301]
RewriteRule ^/faq.*$ http://wiki.creativecommons.org/FAQ [L,R=301]
RewriteRule ^/image/publish-buzznet http://wiki.creativecommons.org/HOWTO_Publish#Buzznet [L,NE,R=301]
RewriteRule ^/image/publish-flickr http://wiki.creativecommons.org/HOWTO_Publish#Flickr [L,NE,R=301]
RewriteRule ^/image/publish-website http://wiki.creativecommons.org/HOWTO_Publish#Adding_a_license_to_your_photo_pages [L,NE,R=301]
RewriteRule ^/(international|affiliates)/?$ http://wiki.creativecommons.org/CC_Affiliate_Network [L,R=301]
RewriteRule ^/international/pr.*$ http://creativecommonspr.org/ [L,R=301]
RewriteRule ^/learn/aboutus/affiliates$ http://wiki.creativecommons.org/CC_Affiliate_Network [L,R=301]
RewriteRule ^/learn/collaborators$ http://wiki.creativecommons.org/CC_Affiliate_Network [L,R=301]
RewriteRule ^/metadata(.*)$ http://wiki.creativecommons.org/Metadata [L,R=301]
RewriteRule ^/participate/?$ http://wiki.creativecommons.org/ [L,R=301]
RewriteRule ^/project/(.*) http://wiki.creativecommons.org/$1 [L,R=301]
RewriteRule ^/projects/(.+) http://wiki.creativecommons.org/$1 [L,NE,R=301]
RewriteRule ^/projects/international(.*)$ http://wiki.creativecommons.org/CC_Affiliate_Network [L,R=301]
RewriteRule ^/salon/?$ http://wiki.creativecommons.org/Salon [L,R=301]
RewriteRule ^/technology/accessories$ http://wiki.creativecommons.org/Browser_Plugin [L,R=301]
RewriteRule ^/technology/challenges$ http://wiki.creativecommons.org/TechChallenges [L,R=301]
RewriteRule ^/technology/mp3$ http://wiki.creativecommons.org/MP3 [L,R=301]
RewriteRule ^/technology/nonweb$ http://wiki.creativecommons.org/Web_Statement [L,R=301]
RewriteRule ^/technology/search.html$ http://search.creativecommons.org/ [L,R=301]
RewriteRule ^/technology/usingmarkup$ http://wiki.creativecommons.org/UsingMarkup [L,R=301]
RewriteRule ^/technology/web$ http://wiki.creativecommons.org/HOWTO_Tag_HTML_pages [L,R=301]
RewriteRule ^/technology/web-integration$ http://wiki.creativecommons.org/Web_Integration_Guide [L,R=301]
RewriteRule ^/technology/xmp.*$ http://wiki.creativecommons.org/XMP [L,R=301]
RewriteRule ^.*/technology/?.*$ http://wiki.creativecommons.org/Developers [L,R=301]
RewriteRule ^/text/publish-weblogs http://wiki.creativecommons.org/HOWTO_Publish#Blog [L,NE,R=301]
RewriteRule ^/text/publish-website http://wiki.creativecommons.org/HOWTO_Publish#Adding_a_license_to_your_existing_website [L,NE,R=301]
RewriteRule ^/tools/cclookup http://wiki.creativecommons.org/CcLookup [L,R=301]
RewriteRule ^/tools/ccpublisher http://wiki.creativecommons.org/CcPublisher [L,R=301]
RewriteRule ^/video/publish-internetarchive http://wiki.creativecommons.org/HOWTO_Publish#Internet_Archive_2 [L,NE,R=301]
RewriteRule ^/video/publish-website http://wiki.creativecommons.org/HOWTO_Publish#Adding_a_license_to_your_video_page [L,NE,R=301]
RewriteRule ^/wiki.* http://wiki.creativecommons.org/ [L,R=301]
RewriteRule ^/(worldwide|international)/translating http://wiki.creativecommons.org/Translating [L,R=301]
RewriteRule ^/worldwide http://wiki.creativecommons.org/CC_Affiliate_Network [L,R=301]
RewriteRule ^/government https://creativecommons.org/publicpolicy [L,R=301]
#----------
# Redirects to CC.net
#----------
# FIXME: a bunch of these have moved / don't exist anymore
RewriteRule ^/about/affiliates.*$ https://creativecommons.net/supporters [R=301,L]
RewriteRule ^/about/lessigletter.*$ https://creativecommons.net/letters [L,R=301]
RewriteRule ^/about/supporters$ https://creativecommons.net/supporters [L,R=301]
RewriteRule ^/donate$ https://creativecommons.net/donate [R=301,L]
RewriteRule /learn/aboutus/supporters$ https://creativecommons.net/supporters [R=301,L]
RewriteRule ^/store$ https://creativecommons.net/store [L,R=301]
RewriteRule /support/getabutton$ https://creativecommons.net/supportcc [R=301,L]
RewriteRule /support/summit$ https://creativecommons.net [R=301,L]
RewriteRule ^/support/?$ https://creativecommons.net/ [L,R=301]
#----------
# Miscellaneous
#----------
# Map backwardly named license types to their actual location
RewriteRule ^/licenses/by-nc-nd/1.0/(.*)$ %{SERVER_PROTOCOL}://%{HTTP_HOST}/licenses/by-nd-nc/1.0/$1 [L,R=301]
RewriteRule ^/licenses/by-nd-nc/2.0/(.*)$ %{SERVER_PROTOCOL}://%{HTTP_HOST}/licenses/by-nc-nd/2.0/$1 [L,R=301]
# Map the namespace document and schema URLs
# FIXME: are symlinks cleaner?
RewriteRule ^/ns$ /rdf/ns.html [L]
RewriteRule ^/schema.rdf$ /rdf/schema.rdf [L]
# Logins should always be HTTPS
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} ^/wp-login\.php.*
RewriteRule ^/(.*)$ https://%{HTTP_HOST}/$1 [R=301,NE,L]
# Redirect creativecommons.ru to the RU international page
ServerAlias creativecommons.ru www.creativecommons.ru
RewriteCond %{HTTP_HOST} =creativecommons.ru [OR]
RewriteCond %{HTTP_HOST} =www.creativecommons.ru
# Redirect opened.creativecommons.org to creativecommons.org/education
ServerAlias opened.creativecommons.org
RewriteCond %{HTTP_HOST} =opened.creativecommons.org
RewriteRule ^.*$ %{SERVER_PROTOCOL}://creativecommons.org/education [L,R=301]
# Redirect www.CC.org to CC.org
RewriteCond %{HTTP_HOST} =www.creativecommons.org
RewriteRule ^/(.*)$ %{SERVER_PROTOCOL}://%{HTTP_HOST}/$1 [L,R=301]
# It's creativecommons.org, not .com
RewriteCond %{HTTP_HOST} =creativecommons.com [OR]
RewriteCond %{HTTP_HOST} =www.creativecommons.com
RewriteRule ^.*$ %{SERVER_PROTOCOL}://%{HTTP_HOST}/ [L,R=301]
#----------
# WordPress rules here instead of .htaccess
#----------
# NOTE: sometimes Wordpress decides what page to display based on both the
# query string AND the REQUEST_URI. mod_rewrite does not alter the
# REQUEST_URI, and therefore mod_rewrite by itself is not always enough to
# coerce Wordpress into doing what we want. In these case, add the query
# argument '&roflcopter' to whatever RewriteRule. This will signal a special
# plugin (cc_rewrite_request_uri.php) to actually alter the REQUEST_URI in the
# PHP environment to be equivalent to the right side of the RewriteRule.
# Catch requests to certain posts and feed them to Wordpress in a way that
# it knows how to handle
RewriteRule ^/weblog(/archive|)/entry/(\d+)/?$ /index.php?p=$2&%{QUERY_STRING}&roflcopter [L]
RewriteRule ^/press-releases/entry/(\d+)/?$ /index.php?p=$1&roflcopter [L]
# Catch any requests for the general /weblog/archive and also to the
# archives for any particular year/month and then redirect the client
# to the new-style permalink
RewriteRule ^/weblog/archive(/?.*)$ %{SERVER_PROTOCOL}://%{HTTP_HOST}/weblog$1 [L,R=301]
# Catch any old permalinks that point to long, ugly post names. The
# CC Permalink Mapper will get this request and redirect the user accordingly.
# But don't do this if someone was trying to access some particular feed
RewriteCond %{REQUEST_URI} !^/([a-z-]+)/\d{4}/\d{2}/feed
RewriteRule ^/([a-z-]+)/\d{4}/\d{2}/([a-zA-Z0-9-]+)/?$ /index.php?post_name=$2&category=$1&roflcopter [L]
# '<some path>/rss' returns an RSS 0.92 feed, which we don't want, so make any
# requests for '<some path>/rss' return an RSS 2 feed.
RewriteRule ^/(.*?)rss/?$ /index.php/$1?feed=rss2 [L]
# Get missing upload files from the main site
# NOTE: disable in production - for staging sites only (so media URLs will work)
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteRule ^/(wp-content/uploads/.*)$ %{SERVER_PROTOCOL}://creativecommons.org/$1 [L]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
<Location />
AuthType Basic
AuthName "This is a testing server and not a public web server of Creative Commons. Please visit creativecommons.org"
AuthUserFile /srv/password
Require valid-user
AllowOverride None
Order allow,deny
allow from all
</Location>
<Location /.well-known/>
Require all granted
</Location>
LogLevel alert rewrite:trace3
</VirtualHost>