forked from creativecommons/creativecommons.org
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapache.conf
460 lines (396 loc) · 25.9 KB
/
apache.conf
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
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
<VirtualHost *:${port}>
ServerName ${host}
DocumentRoot ${dir}/docroot
# CloudFlare doesn't like ranges - 20150804-rob.
Header set Accept-Ranges none
<Directory "${dir}/docroot">
Require all granted
</Directory>
#RedirectPermanent / ${host}
ErrorLog ${logdir}/error.log
CustomLog ${logdir}/access.log combined
#----------
# Main (general configs)
#----------
# Don't display PHP errors to users of the site
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
php_value docref_root 0
php_value docref_ext 0
# Log PHP errors (disable if growing too large)
php_flag log_errors off
php_value error_reporting 1
php_flag ignore_repeated_errors on
php_flag ignore_repeated_source on
php_value error_log ${logdir}/PHP_errors.log
FileETag INode MTime Size
# Options +ExecCGI
# Redirect users to ${host} if they used something else
# (e.g. www.${host}, etc).
UseCanonicalName On
<Location /licenses>
DirectoryIndex deed
DefaultType text/html
AddDefaultCharset utf-8
Require all granted
</Location>
<Location /ccengine-fcgi>
DefaultType text/html
AddDefaultCharset utf-8
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
</Location>
<Location /cc.engine-cache>
DefaultType text/html
AddDefaultCharset utf-8
#Require all granted
</Location>
# Always serve up deeds as text/html, even when the country code
# extension makes Apache think it's something else, like .pl being
# a perl script instead of Poland, but not if it's a CSS file.
<LocationMatch "^/licenses/.*/deed(?!3.css).*$">
ForceType text/html
</LocationMatch>
<LocationMatch "^/cc.engine-cache/.*/deed.*">
ForceType text/html
</LocationMatch>
DirectoryIndex index.php index.html
### ------------------------- ####
## BEGIN mod_rewrite section ##
### ------------------------- ####
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 ${dir}/python_env/bin/ccengine.fcgi
Alias /cc.engine-cache ${dir}/python_env/cache
<Directory ${dir}/python_env/cache>
Require all granted
</Directory>
<Directory ${dir}/python_env/bin>
Options Indexes FollowSymLinks MultiViews ExecCGI
AllowOverride All
#Require local
Require all granted
</Directory>
#RewriteRule "^/discover/gift-guide(.*)$" "/wp-content/themes/creativecommons.org/discover/gift-guide/$1" [PT]
#Alias /discover/gift-guide/ /home/ubuntu/cc-wp-theme/creativecommons.org/discover/gift-guide/
#Alias /discover/gift-guide /home/ubuntu/creativecommons.org/discover/gift-guide
<Directory ${dir}/docroot/discover/gift-guide>
Options Indexes FollowSymLinks MultiViews
# AllowOverride All
# Order allow,deny
# Allow from all
# Require all granted
# Satisfy Any
</Directory>
<Directory ${dir}/docroot/faq/>
Options Indexes FollowSymLinks MultiViews
# AllowOverride All
# Order allow,deny
# Allow from all
# Require all granted
# Satisfy Any
</Directory>
# Redirect all /license to /choose before we go any deeper
RewriteRule ^/choose$ ${proto}://${host}/choose/ [L,R=301]
RewriteRule ^/license$ ${proto}://${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]
RewriteRule ^/licenses/CC0/1.1(.*)$ /publicdomain/zero/1.1$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 ${proto}://${host}/ [L,R=301]
RewriteRule .*legalcode/$ ${proto}://${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]
RewriteRule ^/publicdomain/(.*)/([0-9]\.[0-9])/legalcode\.([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/$ ${proto}://${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 ${dir}/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(.*) ${proto}://${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$ ${proto}://${host}/licenses/ [L,R=301]
RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/([a-z][a-z])$ ${proto}://${host}/licenses/$1/$2/$3/ [L,R=301]
RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/([Ss]cotland)$ ${proto}://${host}/licenses/$1/$2/scotland/ [L,R=301]
RewriteRule ^/licenses/(.*)([0-9])$ ${proto}://${host}/licenses/$1$2/ [L,R=301]
RewriteRule ^/licenses/(.*)/2.0/ar/(.*)$ ${proto}://${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$ ${proto}://${host}/licenses/by-nc-nd/2.0/ [L,R=301]
RewriteRule ^/licenses/by-nc-nd/1.0/legalcode$ ${proto}://${host}/licenses/by-nd-nc/1.0/legalcode [L,R=301]
RewriteRule ^/licenses/by-nc-nd/1.0/$ ${proto}://${host}/licenses/by-nd-nc/1.0/ [L,R=301]
RewriteRule ^/licenses/nc-nd/1.0/legalcode$ ${proto}://${host}/licenses/nd-nc/1.0/legalcode [L,R=301]
RewriteRule ^/licenses/nc-nd/1.0/$ ${proto}://${host}/licenses/nd-nc/1.0/ [L,R=301]
RewriteRule ^/licenses/(.*)/deed.(.*)/$ ${proto}://${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$ ${proto}://${host}/licenses/ [L,R=301]
RewriteRule ^/licenses/MIT/legalcode http://opensource.org/licenses/mit-license.php [L,R]
RewriteRule ^/licenses/publicdomain/1.0(.*)$ ${proto}://${host}/licenses/publicdomain/ [L,R=301]
RewriteRule ^/licenses/zero/1.0/(.*) /publicdomain/zero/1.0/$1 [L,R=301]
RewriteRule ^/licenses/zero/1.1/(.*) /publicdomain/zero/1.1/$1 [L,R=301]
RewriteRule ^/licesne(.*)$ ${proto}://${host}/choose$1 [L,R=301]
RewriteRule ^/public_domain ${proto}://${host}/publicdomain/ [R=301,L]
RewriteRule ^/licenses/(.*) /ccengine-fcgi/licenses/$1 [PT,L]
#----------
# Old content/URLs going to new places
#----------
RewriteRule ^/200.* ${proto}://%{SERVER_NAME}/ [L,R=301]
RewriteRule ^/aboutus ${proto}://%{SERVER_NAME}/about [L,R=301]
RewriteRule ^/about/ccvideo ${proto}://%{SERVER_NAME}/videos/ [L,R=301]
RewriteRule ^/about/license$ ${proto}://%{SERVER_NAME}/licenses/ [L,R=301]
RewriteRule ^/about/licenses/?$ ${proto}://%{SERVER_NAME}/licenses/ [L,R=301]
RewriteRule ^/about/licenses/meet-the-licenses/?$ ${proto}://%{SERVER_NAME}/licenses/ [L,R=301]
RewriteRule /about/licenses/sampling ${proto}://%{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/?$ ${proto}://%{SERVER_NAME}/staff [L,R=301]
Rewriterule ^/about/people/board/?$ ${proto}://%{SERVER_NAME}/board [L,R=301]
Rewriterule ^/about/people/fellows/?$ ${proto}://%{SERVER_NAME}/fellows [L,R=301]
Rewriterule ^/about/opportunities/?$ ${proto}://%{SERVER_NAME}/opportunities [L,R=301]
RewriteRule /about/sampling ${proto}://%{SERVER_NAME}/retiredlicenses [L,R=301]
RewriteRule /about/sampling-movie ${proto}://%{SERVER_NAME}/about/licenses/ [L,R=301]
RewriteRule ^/about/videos$ ${proto}://%{SERVER_NAME}/videos/ [L,R=301]
RewriteRule ^/about/what-is-cc/?$ ${proto}://%{SERVER_NAME}/about [L,R=301]
RewriteRule ^/about/who-uses-cc/?$ ${proto}://%{SERVER_NAME}/who-uses-cc [L,R=301]
RewriteRule .*/archive/archive.* ${proto}://%{SERVER_NAME}/ [L,R=301]
RewriteRule ^/asharedculture/?$ ${proto}://%{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$ ${proto}://%{SERVER_NAME}/ [L,R=301]
RewriteRule ^/choose/devnations$ ${proto}://%{SERVER_NAME}/retiredlicenses [L,R=301]
RewriteRule ^/commoners(.*)?$ /interviews$1 [L,R]
RewriteRule ^/concepts/examples$ ${proto}://%{SERVER_NAME}/licenses/ [L,R=301]
RewriteRule ^/concepts/(.*)$ ${proto}://%{SERVER_NAME}/licenses/ [L,R=301]
RewriteRule ^/counter.* ${proto}://%{SERVER_NAME}/ [L,R=301]
RewriteRule ^(.*)CVS.*$ $1 [L,R=301]
RewriteRule ^/discuss/?$ ${proto}://%{SERVER_NAME}/contact#discuss [L,NE,R=301]
RewriteRule ^/draft/(.*)$ ${proto}://%{SERVER_NAME}/licenses/ [L,R=301]
RewriteRule /drafts/wiki_0.5$ ${proto}://%{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 ^/_.* ${proto}://%{SERVER_NAME}/ [L,R=301]
RewriteRule ^/features(.*)$ ${proto}://%{SERVER_NAME}/licenses/ [L,R=301]
RewriteRule ^/fellows ${proto}://%{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 ${proto}://%{SERVER_NAME}/ [L,R=301]
RewriteRule ^/http.* ${proto}://%{SERVER_NAME}/ [L,R=301]
RewriteRule ^/icon/(.*)$ ${proto}://%{SERVER_NAME}/icons/$1 [L,R=301]
RewriteRule ^/image/([-a-z0-9]+)/?$ /index.php?category_name=image&name=$1 [QSA,L]
RewriteRule ^/images.*/$ ${proto}://%{SERVER_NAME}/ [L,R=301]
RewriteRule index_html ${proto}://%{SERVER_NAME}/ [L,R=301]
RewriteRule ^/interviews/([-a-z0-9]+)/?$ /index.php?category_name=interviews&name=$1 [QSA,L]
RewriteRule /learn/aboutus/$ ${proto}://%{SERVER_NAME}/about/history [L,R=301]
RewriteRule /learn/aboutus/people$ ${proto}://%{SERVER_NAME}/about/people [L,R=301]
RewriteRule /learn/artistscorners/educators$ ${proto}://%{SERVER_NAME}/education [L,R=301]
RewriteRule /taa-grant-program$ http://open4us.org/ [L,R=301]
RewriteRule /learn/artistscorners/$ ${proto}://%{SERVER_NAME}/ [L,R=301]
RewriteRule /learn/artistscorners/filmmakers$ ${proto}://%{SERVER_NAME}/video [L,R=301]
RewriteRule /learn/artistscorners/musicians$ ${proto}://%{SERVER_NAME}/audio [L,R=301]
RewriteRule /learn/artistscorners/photographers$ ${proto}://%{SERVER_NAME}/image [L,R=301]
RewriteRule /learn/artistscorners/writers$ ${proto}://%{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/$ ${proto}://%{SERVER_NAME}/licenses/ [L,R=301]
RewriteRule /learn/licenses ${proto}://%{SERVER_NAME}/licenses/ [L,R=301]
RewriteRule /learn/$ ${proto}://%{SERVER_NAME}/about [L,R=301]
RewriteRule ^/learnmore/?$ ${proto}://%{SERVER_NAME}/about [L,R=301]
RewriteRule ^/legal/.*$ ${proto}://%{SERVER_NAME}/ [L,R=301]
RewriteRule .*/login_form$ ${proto}://%{SERVER_NAME}/ [L,R=301]
RewriteRule .*/manage.*$ ${proto}://%{SERVER_NAME}/ [L,R=301]
RewriteRule ^/media-that-matters-video/?$ ${proto}://%{SERVER_NAME}/videos/media-that-matters [L,R=301]
RewriteRule ^/news/blog/$ ${proto}://%{SERVER_NAME}/weblog [L,R=301]
RewriteRule ^/news/pressarchive.html$ ${proto}://%{SERVER_NAME}/weblog [L,R=301]
RewriteRule ^/news/pressarchive$ ${proto}://%{SERVER_NAME}/weblog [L,R=301]
RewriteRule ^/news/pressreleases ${proto}://%{SERVER_NAME}/press-releases [L,R=301]
RewriteRule ^/policy$ ${proto}://%{SERVER_NAME}/policies [L,R=301]
RewriteRule ^/press/.*$ ${proto}://%{SERVER_NAME}/weblog [L,R=301]
RewriteRule ^/press$ ${proto}://%{SERVER_NAME}/weblog [L,R=301]
RewriteRule ^/pressarchive$ ${proto}://%{SERVER_NAME}/weblog [L,R=301]
RewriteRule ^/presskit/(.+)\.([a-z]+)$ http://mirrors.creativecommons.org/presskit/$1.$2 [L,R=301]
RewriteRule ^/presskit ${proto}://%{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 ${proto}://%{SERVER_NAME}/retiredlicenses [L,R=301]
RewriteRule /support/video$ ${proto}://%{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]
#----------
# 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/(.*)$ ${proto}://${host}/licenses/by-nd-nc/1.0/$1 [L,R=301]
RewriteRule ^/licenses/by-nd-nc/2.0/(.*)$ ${proto}://${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://${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
RewriteRule ^.*$ http://wiki.creativecommons.org/Ru:Заглавная+страница [L,R=302]
# Redirect opened.creativecommons.org to creativecommons.org/education
ServerAlias opened.creativecommons.org
RewriteCond %{HTTP_HOST} =opened.creativecommons.org
RewriteRule ^.*$ ${proto}://creativecommons.org/education [L,R=301]
# Redirect www.CC.org to CC.org
RewriteCond %{HTTP_HOST} =www.creativecommons.org
RewriteRule ^/(.*)$ ${proto}://${host}/$1 [L,R=301]
# It's creativecommons.org, not .com
RewriteCond %{HTTP_HOST} =creativecommons.com [OR]
RewriteCond %{HTTP_HOST} =www.creativecommons.com
RewriteRule ^.*$ ${proto}://${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.
RewriteRule ^/weblog/feed/$ https://blog.creativecommons.org/feed/ [L,R=301]
# 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]
RewriteRule ^/weblog(/archive|)/entry/(\d+)/?$ https://blog.creativecommons.org/index.php?p=$2&%{QUERY_STRING} [L]
RewriteRule ^/weblog(/archive|)/(\d+)/?$ https://blog.creativecommons.org/$2 [L]
RewriteRule ^/weblog/?$ https://blog.creativecommons.org/ [L]
RewriteRule ^/press-releases/entry/(\d+)/?$ https://blog.creativecommons.org/index.php?p=$1 [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(/?.*)$ https://blog.creativecommons.org$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/.*)$ ${proto}://creativecommons.org/$1 [L]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
SSLEngine on
SSLCertificateFile /etc/ssl/private/${host}.crt
SSLCertificateKeyFile /etc/ssl/private/${host}.key
SSLCACertificateFile /etc/ssl/certs/RapidSSL_CA_bundle.pem
</VirtualHost>