-
Notifications
You must be signed in to change notification settings - Fork 208
/
Copy pathdefault-ssl.conf
565 lines (494 loc) · 31.6 KB
/
default-ssl.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
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
<VirtualHost *:443>
ServerName creativecommons.org
DocumentRoot /var/www/creativecommons.org/docroot
# CloudFlare doesn't like ranges - 20150804-rob.
Header set Accept-Ranges none
<Directory /var/www/creativecommons.org/docroot/>
Require all granted
</Directory>
#ErrorLog /dev/null
#ErrorLog /mnt/var/log/apache2/creativecommons.org/error.log
#CustomLog /mnt/var/log/apache2/creativecommons.org/access.log common
#----------
# Main (general configs)
#----------
<IfModule mod_php.c>
# 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 /mnt/var/log/apache2/creativecommons.org/PHP_errors.log
</IfModule>
FileETag INode MTime Size
#Options +ExecCGI
# Redirect users to creativecommons.org if they used something else
# (e.g. www.creativecommons.org, etc).
UseCanonicalName On
<Location /licenses>
DirectoryIndex deed
DefaultType text/html
AddDefaultCharset utf-8
</Location>
<Location /ccengine-fcgi>
DefaultType text/html
AddDefaultCharset utf-8
#Require local
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 /var/www/creativecommons.org/python_env/bin/ccengine.fcgi
Alias /cc.engine-cache /var/www/creativecommons.org/python_env/cache
<Directory /var/www/creativecommons.org/python_env/cache>
Require all granted
</Directory>
<Directory /var/www/creativecommons.org/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/ /var/www/cc-wp-theme/creativecommons.org/discover/gift-guide/
#Alias /discover/gift-guide /var/www/creativecommons.org/discover/gift-guide
<Directory /var/www/creativecommons.org/discover/gift-guide>
Options Indexes FollowSymLinks MultiViews
# AllowOverride All
# Order allow,deny
# Allow from all
# Require all granted
# Satisfy Any
</Directory>
<Directory /var/www/creativecommons.org/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$ http://creativecommons.org/choose/ [L,R=301]
RewriteRule ^/license$ http://creativecommons.org/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 http://creativecommons.org/ [L,R=301]
RewriteRule .*legalcode/$ http://creativecommons.org/ [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-z][a-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/$ http://creativecommons.org/ [L,R=301]
# See if deed is cached before sending to cc.engine
# FIXME: eval memcache as an alternative?
RewriteCond %{REQUEST_URI} ^/licenses
RewriteCond /var/www/creativecommons.org//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(.*) http://creativecommons.org$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$ http://creativecommons.org/licenses/ [L,R=301]
RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/([a-z][a-z])$ http://creativecommons.org/licenses/$1/$2/$3/ [L,R=301]
RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/([Ss]cotland)$ http://creativecommons.org/licenses/$1/$2/scotland/ [L,R=301]
RewriteRule ^/licenses/(.*)([0-9])$ http://creativecommons.org/licenses/$1$2/ [L,R=301]
RewriteRule ^/licenses/(.*)/2.0/ar/(.*)$ http://creativecommons.org/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$ http://creativecommons.org/licenses/by-nc-nd/2.0/ [L,R=301]
RewriteRule ^/licenses/by-nc-nd/1.0/legalcode$ http://creativecommons.org/licenses/by-nd-nc/1.0/legalcode [L,R=301]
RewriteRule ^/licenses/by-nc-nd/1.0/$ http://creativecommons.org/licenses/by-nd-nc/1.0/ [L,R=301]
RewriteRule ^/licenses/nc-nd/1.0/legalcode$ http://creativecommons.org/licenses/nd-nc/1.0/legalcode [L,R=301]
RewriteRule ^/licenses/nc-nd/1.0/$ http://creativecommons.org/licenses/nd-nc/1.0/ [L,R=301]
RewriteRule ^/licenses/(.*)/deed.(.*)/$ http://creativecommons.org/ [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$ http://creativecommons.org/licenses/ [L,R=301]
RewriteRule ^/licenses/MIT/legalcode http://opensource.org/licenses/mit-license.php [L,R]
RewriteRule ^/licenses/publicdomain/1.0(.*)$ http://creativecommons.org/licenses/publicdomain/ [L,R=301]
RewriteRule ^/licenses/zero/1.0/(.*) /publicdomain/zero/1.0/$1 [L,R=301]
RewriteRule ^/licesne(.*)$ http://creativecommons.org/choose$1 [L,R=301]
RewriteRule ^/public_domain http://creativecommons.org/publicdomain/ [R=301,L]
RewriteRule ^/licenses/(.*) /ccengine-fcgi/licenses/$1 [PT,L]
#----------
# Old content/URLs going to new places
#----------
RewriteRule ^/200.* http://%{SERVER_NAME}/ [L,R=301]
RewriteRule ^/aboutus http://%{SERVER_NAME}/about [L,R=301]
RewriteRule ^/about/ccvideo http://%{SERVER_NAME}/videos/ [L,R=301]
RewriteRule ^/about/license$ http://%{SERVER_NAME}/licenses/ [L,R=301]
RewriteRule ^/about/licenses/?$ http://%{SERVER_NAME}/licenses/ [L,R=301]
RewriteRule ^/about/licenses/meet-the-licenses/?$ http://%{SERVER_NAME}/licenses/ [L,R=301]
RewriteRule /about/licenses/sampling http://%{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/?$ http://%{SERVER_NAME}/staff [L,R=301]
Rewriterule ^/about/people/board/?$ http://%{SERVER_NAME}/board [L,R=301]
Rewriterule ^/about/people/fellows/?$ http://%{SERVER_NAME}/fellows [L,R=301]
Rewriterule ^/about/opportunities/?$ http://%{SERVER_NAME}/opportunities [L,R=301]
RewriteRule /about/sampling http://%{SERVER_NAME}/retiredlicenses [L,R=301]
RewriteRule /about/sampling-movie http://%{SERVER_NAME}/about/licenses/ [L,R=301]
RewriteRule ^/about/videos$ http://%{SERVER_NAME}/videos/ [L,R=301]
RewriteRule ^/about/what-is-cc/?$ http://%{SERVER_NAME}/about [L,R=301]
RewriteRule ^/about/who-uses-cc/?$ http://%{SERVER_NAME}/who-uses-cc [L,R=301]
RewriteRule .*/archive/archive.* http://%{SERVER_NAME}/ [L,R=301]
RewriteRule ^/asharedculture/?$ http://%{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$ http://%{SERVER_NAME}/ [L,R=301]
RewriteRule ^/choose/devnations$ http://%{SERVER_NAME}/retiredlicenses [L,R=301]
RewriteRule ^/commoners(.*)?$ /interviews$1 [L,R]
RewriteRule ^/concepts/examples$ http://%{SERVER_NAME}/licenses/ [L,R=301]
RewriteRule ^/concepts/(.*)$ http://%{SERVER_NAME}/licenses/ [L,R=301]
RewriteRule ^/counter.* http://%{SERVER_NAME}/ [L,R=301]
RewriteRule ^(.*)CVS.*$ $1 [L,R=301]
RewriteRule ^/discuss/?$ http://%{SERVER_NAME}/contact#discuss [L,NE,R=301]
RewriteRule ^/draft/(.*)$ http://%{SERVER_NAME}/licenses/ [L,R=301]
RewriteRule /drafts/wiki_0.5$ http://%{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 ^/_.* http://%{SERVER_NAME}/ [L,R=301]
RewriteRule ^/features(.*)$ http://%{SERVER_NAME}/licenses/ [L,R=301]
RewriteRule ^/fellows http://%{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 http://%{SERVER_NAME}/ [L,R=301]
RewriteRule ^/http.* http://%{SERVER_NAME}/ [L,R=301]
RewriteRule ^/icon/(.*)$ http://%{SERVER_NAME}/icons/$1 [L,R=301]
RewriteRule ^/image/([-a-z0-9]+)/?$ /index.php?category_name=image&name=$1 [QSA,L]
RewriteRule ^/images.*/$ http://%{SERVER_NAME}/ [L,R=301]
RewriteRule index_html http://%{SERVER_NAME}/ [L,R=301]
RewriteRule ^/interviews/([-a-z0-9]+)/?$ /index.php?category_name=interviews&name=$1 [QSA,L]
RewriteRule /learn/aboutus/$ http://%{SERVER_NAME}/about/history [L,R=301]
RewriteRule /learn/aboutus/people$ http://%{SERVER_NAME}/about/people [L,R=301]
RewriteRule /learn/artistscorners/educators$ http://%{SERVER_NAME}/education [L,R=301]
RewriteRule /taa-grant-program$ http://open4us.org/ [L,R=301]
RewriteRule /learn/artistscorners/$ http://%{SERVER_NAME}/ [L,R=301]
RewriteRule /learn/artistscorners/filmmakers$ http://%{SERVER_NAME}/video [L,R=301]
RewriteRule /learn/artistscorners/musicians$ http://%{SERVER_NAME}/audio [L,R=301]
RewriteRule /learn/artistscorners/photographers$ http://%{SERVER_NAME}/image [L,R=301]
RewriteRule /learn/artistscorners/writers$ http://%{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/$ http://%{SERVER_NAME}/licenses/ [L,R=301]
RewriteRule /learn/licenses http://%{SERVER_NAME}/licenses/ [L,R=301]
RewriteRule /learn/$ http://%{SERVER_NAME}/about [L,R=301]
RewriteRule ^/learnmore/?$ http://%{SERVER_NAME}/about [L,R=301]
RewriteRule ^/legal/.*$ http://%{SERVER_NAME}/ [L,R=301]
RewriteRule .*/login_form$ http://%{SERVER_NAME}/ [L,R=301]
RewriteRule .*/manage.*$ http://%{SERVER_NAME}/ [L,R=301]
RewriteRule ^/media-that-matters-video/?$ http://%{SERVER_NAME}/videos/media-that-matters [L,R=301]
RewriteRule ^/news/blog/$ http://%{SERVER_NAME}/weblog [L,R=301]
RewriteRule ^/news/pressarchive.html$ http://%{SERVER_NAME}/weblog [L,R=301]
RewriteRule ^/news/pressarchive$ http://%{SERVER_NAME}/weblog [L,R=301]
RewriteRule ^/news/pressreleases http://%{SERVER_NAME}/press-releases [L,R=301]
RewriteRule ^/policy$ http://%{SERVER_NAME}/policies [L,R=301]
RewriteRule ^/press/.*$ http://%{SERVER_NAME}/weblog [L,R=301]
RewriteRule ^/press$ http://%{SERVER_NAME}/weblog [L,R=301]
RewriteRule ^/pressarchive$ http://%{SERVER_NAME}/weblog [L,R=301]
RewriteRule ^/presskit/(.+)\.([a-z]+)$ http://mirrors.creativecommons.org/presskit/$1.$2 [L,R=301]
RewriteRule ^/presskit http://%{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 http://%{SERVER_NAME}/retiredlicenses [L,R=301]
RewriteRule /support/video$ http://%{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 http://creativecommons.org/publicpolicy [L,R=301]
#----------
# Redirects to CC.net
#----------
# FIXME: a bunch of these have moved / don't exist anymore
RewriteRule ^/about/affiliates.*$ http://creativecommons.net/supporters [R=301,L]
RewriteRule ^/about/lessigletter.*$ http://creativecommons.net/letters [L,R=301]
RewriteRule ^/about/supporters$ http://creativecommons.net/supporters [L,R=301]
RewriteRule ^/donate$ http://creativecommons.net/donate [R=301,L]
RewriteRule /learn/aboutus/supporters$ http://creativecommons.net/supporters [R=301,L]
RewriteRule ^/store$ http://creativecommons.net/store [L,R=301]
RewriteRule /support/getabutton$ http://creativecommons.net/supportcc [R=301,L]
RewriteRule /support/summit$ http://creativecommons.net [R=301,L]
RewriteRule ^/support/?$ http://creativecommons.net/ [L,R=301]
#----------
# Miscellaneous
#----------
# Map backwardly named license types to their actual location
RewriteRule ^/licenses/by-nc-nd/1.0/(.*)$ http://creativecommons.org/licenses/by-nd-nc/1.0/$1 [L,R=301]
RewriteRule ^/licenses/by-nd-nc/2.0/(.*)$ http://creativecommons.org/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 HTTP
#RewriteCond %{HTTP} off
#RewriteCond %{REQUEST_URI} ^/wp-login\.php.*
#RewriteRule ^/(.*)$ http://creativecommons.org/$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 ^.*$ http://creativecommons.org/education [L,R=301]
# Redirect www.CC.org to CC.org
RewriteCond %{HTTP_HOST} =www.creativecommons.org
RewriteRule ^/(.*)$ http://creativecommons.org/$1 [L,R=301]
# It's creativecommons.org, not .com
RewriteCond %{HTTP_HOST} =creativecommons.com [OR]
RewriteCond %{HTTP_HOST} =www.creativecommons.com
RewriteRule ^.*$ http://creativecommons.org/ [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]
RewriteRule ^/feed/(.*?)?$ https://blog.creativecommons.org/feed/?$1 [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/.*)$ http://creativecommons.org/$1 [L]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# SSL Engine Switch:
# Enable/Disable SSL for this virtual host.
SSLEngine on
# A self-signed (snakeoil) certificate can be created by installing
# the ssl-cert package. See
# /usr/share/doc/apache2/README.Debian.gz for more info.
# If both key and certificate are stored in the same file, only the
# SSLCertificateFile directive is needed.
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
# Server Certificate Chain:
# Point SSLCertificateChainFile at a file containing the
# concatenation of PEM encoded CA certificates which form the
# certificate chain for the server certificate. Alternatively
# the referenced file can be the same as SSLCertificateFile
# when the CA certificates are directly appended to the server
# certificate for convinience.
#SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt
# Certificate Authority (CA):
# Set the CA certificate verification path where to find CA
# certificates for client authentication or alternatively one
# huge file containing all of them (file must be PEM encoded)
# Note: Inside SSLCACertificatePath you need hash symlinks
# to point to the certificate files. Use the provided
# Makefile to update the hash symlinks after changes.
#SSLCACertificatePath /etc/ssl/certs/
#SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt
# Certificate Revocation Lists (CRL):
# Set the CA revocation path where to find CA CRLs for client
# authentication or alternatively one huge file containing all
# of them (file must be PEM encoded)
# Note: Inside SSLCARevocationPath you need hash symlinks
# to point to the certificate files. Use the provided
# Makefile to update the hash symlinks after changes.
#SSLCARevocationPath /etc/apache2/ssl.crl/
#SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl
# Client Authentication (Type):
# Client certificate verification type and depth. Types are
# none, optional, require and optional_no_ca. Depth is a
# number which specifies how deeply to verify the certificate
# issuer chain before deciding the certificate is not valid.
#SSLVerifyClient require
#SSLVerifyDepth 10
# SSL Engine Options:
# Set various options for the SSL engine.
# o FakeBasicAuth:
# Translate the client X.509 into a Basic Authorisation. This means that
# the standard Auth/DBMAuth methods can be used for access control. The
# user name is the `one line' version of the client's X.509 certificate.
# Note that no password is obtained from the user. Every entry in the user
# file needs this password: `xxj31ZMTZzkVA'.
# o ExportCertData:
# This exports two additional environment variables: SSL_CLIENT_CERT and
# SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
# server (always existing) and the client (only existing when client
# authentication is used). This can be used to import the certificates
# into CGI scripts.
# o StdEnvVars:
# This exports the standard SSL/TLS related `SSL_*' environment variables.
# Per default this exportation is switched off for performance reasons,
# because the extraction step is an expensive operation and is usually
# useless for serving static content. So one usually enables the
# exportation for CGI and SSI requests only.
# o OptRenegotiate:
# This enables optimized SSL connection renegotiation handling when SSL
# directives are used in per-directory context.
#SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
# SSL Protocol Adjustments:
# The safe and default but still SSL/TLS standard compliant shutdown
# approach is that mod_ssl sends the close notify alert but doesn't wait for
# the close notify alert from client. When you need a different shutdown
# approach you can use one of the following variables:
# o ssl-unclean-shutdown:
# This forces an unclean shutdown when the connection is closed, i.e. no
# SSL close notify alert is send or allowed to received. This violates
# the SSL/TLS standard but is needed for some brain-dead browsers. Use
# this when you receive I/O errors because of the standard approach where
# mod_ssl sends the close notify alert.
# o ssl-accurate-shutdown:
# This forces an accurate shutdown when the connection is closed, i.e. a
# SSL close notify alert is send and mod_ssl waits for the close notify
# alert of the client. This is 100% SSL/TLS standard compliant, but in
# practice often causes hanging connections with brain-dead browsers. Use
# this only for browsers where you know that their SSL implementation
# works correctly.
# Notice: Most problems of broken clients are also related to the HTTP
# keep-alive facility, so you usually additionally want to disable
# keep-alive for those clients, too. Use variable "nokeepalive" for this.
# Similarly, one has to force some clients to use HTTP/1.0 to workaround
# their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
# "force-response-1.0" for this.
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
# MSIE 7 and newer should be able to use keepalive
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
</VirtualHost>