22 ServerName chooser.productionwww.creativecommons.uk0.bigv.io
33 #ServerName creativecommons.org
44 DocumentRoot /var/www/creativecommons.org/docroot
5-
5+
66 # CloudFlare doesn't like ranges - 20150804-rob.
77 Header set Accept-Ranges none
88
1111
1212 # For munin
1313 <IfModule mod_status.c >
14- <Location /server-status>
15- SetHandler server-status
16- Require local
17- </Location>
14+ <Location /server-status >
15+ SetHandler server-status
16+ Require local
17+ </Location >
1818 </IfModule >
1919
2020 <Directory /var/www/html >
21- Options -Indexes
22- Require all granted
21+ Options -Indexes
22+ Require all granted
2323 </Directory >
2424
2525 #ErrorLog /dev/null
6161 DirectoryIndex deed
6262 DefaultType text/html
6363 AddDefaultCharset utf-8
64- Require all granted
64+ Require all granted
6565 </Location >
6666
6767 # Always serve up deeds as text/html, even when the country code
8080 ### ------------------------- ####
8181 ## BEGIN mod_rewrite section ##
8282 ### ------------------------- ####
83-
83+
8484 RewriteEngine on
85-
85+
8686 #----------
8787 # Logging. Uncomment these lines and adjust the log level for debugging. Make
8888 # sure to recomment them and restart Apache when done because the file will
8989 # become immense in a hurry.
9090 #----------
91-
91+
9292 #RewriteLog /tmp/rewrite.log
9393 #RewriteLogLevel 5
94-
94+
9595 #----------
9696 # Config
9797 #----------
98-
98+
9999 RewriteMap uppercase int:toupper
100-
100+
101101 #----------
102102 # License engine and legalcode
103103 #----------
104104
105- ScriptAlias /ccengine-fcgi /var/www/creativecommons.org/python_env/bin/ccengine.fcgi
106- <Location /ccengine-fcgi>
107- AllowOverride all
108- DefaultType text/html
109- AddDefaultCharset utf-8
110- # # #Require local
111- # # Require all granted
105+ ScriptAlias /ccengine-fcgi /var/www/creativecommons.org/python_env/bin/ccengine.fcgi
106+ <Location /ccengine-fcgi >
107+ AllowOverride all
108+ DefaultType text/html
109+ AddDefaultCharset utf-8
110+ #Require local
111+ # Require all granted
112112 </Location >
113113
114114 Alias /cc.engine-cache /var/www/creativecommons.org/python_env/cache
115115 <Location /cc.engine-cache >
116116 AllowOverride all
117117 DefaultType text/html
118118 AddDefaultCharset utf-8
119- Require all granted
119+ Require all granted
120120 </Location >
121121
122122 <Directory /var/www/creativecommons.org/python_env/cache >
123- Require all granted
123+ Require all granted
124124 </Directory >
125125
126126 <Directory /var/www/creativecommons.org/python_env/bin >
127- Options Indexes FollowSymLinks MultiViews ExecCGI
128- AllowOverride All
129- Require local
130- Require all granted
127+ Options Indexes FollowSymLinks MultiViews ExecCGI
128+ AllowOverride All
129+ Require local
130+ Require all granted
131131 </Directory >
132132
133133 #RewriteRule "^/discover/gift-guide(.*)$" "/wp-content/themes/creativecommons.org/discover/gift-guide/$1" [PT]
134- #Alias /discover/gift-guide/ /var/www/cc-wp-theme/creativecommons.org/discover/gift-guide/
134+ #Alias /discover/gift-guide/ /var/www/cc-wp-theme/creativecommons.org/discover/gift-guide/
135135 #Alias /discover/gift-guide /var/www/creativecommons.org/discover/gift-guide
136136 <Directory /var/www/creativecommons.org/discover/gift-guide >
137137 Options Indexes FollowSymLinks MultiViews
138- # AllowOverride All
139- # Order allow,deny
140- # Allow from all
141- # Require all granted
142- # Satisfy Any
138+ # AllowOverride All
139+ # Order allow,deny
140+ # Allow from all
141+ # Require all granted
142+ # Satisfy Any
143143 </Directory >
144144
145145 <Directory /var/www/creativecommons.org/faq/ >
146146 Options Indexes FollowSymLinks MultiViews
147- # AllowOverride All
148- # Order allow,deny
149- # Allow from all
150- # Require all granted
151- # Satisfy Any
147+ # AllowOverride All
148+ # Order allow,deny
149+ # Allow from all
150+ # Require all granted
151+ # Satisfy Any
152152 </Directory >
153153
154154 # Redirect all /license to /choose before we go any deeper
155155 RewriteRule ^/choose$ http://creativecommons.org/choose/ [L,R=301 ]
156156 RewriteRule ^/license$ http://creativecommons.org/choose/ [L,R=301 ]
157-
157+
158158 # Fixes this repercussions of this bug:
159159 # http://code.creativecommons.org/issues/issue898
160160 RewriteRule ^/licenses/CC0/1.0(.*)$ /publicdomain/zero/1.0$1 [L,R=301 ]
161-
161+
162162 # Legalcode rewrites
163- # FIXME: eval whether we should use the LHS as the actual file structure so we don't need the rewrites
163+ # FIXME: eval whether we should use the LHS as the actual file structure so we don't need the rewrites
164164 RewriteRule ^/legalcode http://creativecommons.org/ [L,R=301 ]
165165 RewriteRule .*legalcode/$ http://creativecommons.org/ [L,R=301 ]
166- RewriteRule ^/licenses/(.*)sampling\+/1.0/(.*)/legalcode$ /legalcode/$1samplingplus_1.0_$2.html [L]
167- RewriteRule ^/licenses/(.*)sampling\+/1.0/legalcode$ /legalcode/$1samplingplus_1.0.html [L]
166+ RewriteRule ^/licenses/(.*)sampling\+/1.0/(.*)/legalcode$ /legalcode/$1samplingplus_1.0_$2.html [L]
167+ RewriteRule ^/licenses/(.*)sampling\+/1.0/legalcode$ /legalcode/$1samplingplus_1.0.html [L]
168168 RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/(.*)/legalcode\.([A-Za-z-]+)$ /legalcode/$1_$2_$3_$4.html [L]
169- RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/legalcode\.([a-z][a-z])$ /legalcode/$1_$2_$3.html [L]
170- RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/(.*)/legalcode$ /legalcode/$1_$2_$3.html [L]
171- RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/legalcode$ /legalcode/$1_$2.html [L]
172- RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/legalcode\.txt$ /legalcode/$1_$2.txt [L]
173- RewriteRule ^/publicdomain/(.*)/([0-9]\.[0-9])/legalcode$ /legalcode/$1_$2.html [L]
174- RewriteRule ^/publicdomain/(.*)/([0-9]\.[0-9])/legalcode\.([a-z][a-z])$ /legalcode/$1_$2_$3.html [L]
169+ RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/legalcode\.([a-z][a-z])$ /legalcode/$1_$2_$3.html [L]
170+ RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/(.*)/legalcode$ /legalcode/$1_$2_$3.html [L]
171+ RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/legalcode$ /legalcode/$1_$2.html [L]
172+ RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/legalcode\.txt$ /legalcode/$1_$2.txt [L]
173+ RewriteRule ^/publicdomain/(.*)/([0-9]\.[0-9])/legalcode$ /legalcode/$1_$2.html [L]
174+ RewriteRule ^/publicdomain/(.*)/([0-9]\.[0-9])/legalcode\.([a-z][a-z])$ /legalcode/$1_$2_$3.html [L]
175175 RewriteRule ^/publicdomain/(.*)/([0-9]\.[0-9])/legalcode\.txt$ /legalcode/$1_$2.txt [L]
176-
176+
177177 # License RDF rewrites
178- # FIXME: eval whether we should use the LHS as the actual file structure so we don't need the rewrites
178+ # FIXME: eval whether we should use the LHS as the actual file structure so we don't need the rewrites
179179 RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/([a-z]+)/license_rdf$ /license_rdf/creativecommons.org_licenses_$1_$2_$3_.rdf [L,T=application/rdf+xml]
180180 RewriteRule ^/licenses/(.*)/([0-9]\.[0-9])/([a-z]+)/rdf$ /license_rdf/creativecommons.org_licenses_$1_$2_$3_.rdf [L,T=application/rdf+xml]
181181 RewriteRule ^/licenses/index.rdf$ /rdf/index.rdf [L,T=application/rdf+xml]
@@ -184,14 +184,14 @@ Require local
184184 RewriteRule ^/(publicdomain|licenses)/(.*)/([0-9]\.[0-9])/license_rdf$ /license_rdf/creativecommons.org_$1_$2_$3_.rdf [L,T=application/rdf+xml]
185185 RewriteRule ^/(publicdomain|licenses)/(.*)/([0-9]\.[0-9])/rdf$ /license_rdf/creativecommons.org_$1_$2_$3_.rdf [L,T=application/rdf+xml]
186186 RewriteRule .*rdf/$ http://creativecommons.org/ [L,R=301 ]
187-
187+
188188 # See if deed is cached before sending to cc.engine
189- # FIXME: eval memcache as an alternative?
189+ # FIXME: eval memcache as an alternative?
190190 RewriteCond %{REQUEST_URI} ^/licenses
191191 RewriteCond /var/www/creativecommons.org//python_env/cache/%{REQUEST_FILENAME} -s
192192 RewriteRule ^/licenses/(.*) /cc.engine-cache/licenses/$1 [L,PT]
193-
194- # FIXME: do we really need rewrites for other licenses like GPL, etc?
193+
194+ # FIXME: do we really need rewrites for other licenses like GPL, etc?
195195 RewriteRule (.*)licence(.*) http://creativecommons.org$1license$2 [L,R=301 ]
196196 RewriteRule ^/(license|choose|characteristic|publicdomain)$ http://creativecommons.org/$1/ [L,R=301 ]
197197 RewriteRule ^/(license|choose|characteristic|publicdomain)/(.*) /ccengine-fcgi/$1/$2 [PT,L]
@@ -366,11 +366,11 @@ Require local
366366
367367 RewriteRule ^/government http://creativecommons.org/publicpolicy [L,R=301 ]
368368
369- #----------
369+ #----------
370370 # Redirects to CC.net
371- #----------
372- # FIXME: a bunch of these have moved / don't exist anymore
373-
371+ #----------
372+ # FIXME: a bunch of these have moved / don't exist anymore
373+
374374 RewriteRule ^/about/affiliates.*$ http://creativecommons.net/supporters [R=301 ,L]
375375 RewriteRule ^/about/lessigletter.*$ http://creativecommons.net/letters [L,R=301 ]
376376 RewriteRule ^/about/supporters$ http://creativecommons.net/supporters [L,R=301 ]
@@ -384,13 +384,13 @@ Require local
384384 #----------
385385 # Miscellaneous
386386 #----------
387-
387+
388388 # Map backwardly named license types to their actual location
389389 RewriteRule ^/licenses/by-nc-nd/1.0/(.*)$ http://creativecommons.org/licenses/by-nd-nc/1.0/$1 [L,R=301 ]
390390 RewriteRule ^/licenses/by-nd-nc/2.0/(.*)$ http://creativecommons.org/licenses/by-nc-nd/2.0/$1 [L,R=301 ]
391-
391+
392392 # Map the namespace document and schema URLs
393- # FIXME: are symlinks cleaner?
393+ # FIXME: are symlinks cleaner?
394394 RewriteRule ^/ns$ /rdf/ns.html [L]
395395 RewriteRule ^/schema.rdf$ /rdf/schema.rdf [L]
396396
@@ -424,11 +424,11 @@ Require local
424424 # https://github.com/creativecommons/creativecommons.org/issues/568
425425
426426 Redirect permanent /chooser https://creativecommons.org/choose/
427-
427+
428428 #----------
429429 # WordPress rules here instead of .htaccess
430430 #----------
431-
431+
432432 # NOTE: sometimes Wordpress decides what page to display based on both the
433433 # query string AND the REQUEST_URI. mod_rewrite does not alter the
434434 # REQUEST_URI, and therefore mod_rewrite by itself is not always enough to
@@ -448,21 +448,21 @@ Require local
448448 RewriteRule ^/weblog(/archive|)/(\d+)/?$ https://blog.creativecommons.org/$2 [L]
449449 RewriteRule ^/weblog/?$ https://blog.creativecommons.org/ [L]
450450 RewriteRule ^/press-releases/entry/(\d+)/?$ https://blog.creativecommons.org/index.php?p=$1 [L]
451-
451+
452452 # Catch any requests for the general /weblog/archive and also to the
453453 # archives for any particular year/month and then redirect the client
454454 # to the new-style permalink
455455 RewriteRule ^/weblog/archive(/?.*)$ https://blog.creativecommons.org$1 [L,R=301 ]
456-
456+
457457 # Catch any old permalinks that point to long, ugly post names. The
458458 # CC Permalink Mapper will get this request and redirect the user accordingly.
459459 # But don't do this if someone was trying to access some particular feed
460460 RewriteCond %{REQUEST_URI} !^/([a-z-]+)/\d{4}/\d{2}/feed
461461 RewriteRule ^/([a-z-]+)/\d{4}/\d{2}/([a-zA-Z0-9-]+)/?$ /index.php?post_name=$2&category=$1&roflcopter [L]
462-
462+
463463 # '<some path>/rss' returns an RSS 0.92 feed, which we don't want, so make any
464464 # requests for '<some path>/rss' return an RSS 2 feed.
465- RewriteRule ^/(.*?)rss/?$ /index.php/$1?feed=rss2 [L]
465+ RewriteRule ^/(.*?)rss/?$ /index.php/$1?feed=rss2 [L]
466466
467467 RewriteRule ^/feed/(.*?)?$ https://blog.creativecommons.org/feed/?$1 [L]
468468
@@ -471,10 +471,11 @@ Require local
471471 RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
472472 RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
473473 RewriteRule ^/(wp-content/uploads/.*)$ http://creativecommons.org/$1 [L]
474-
474+
475475 RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
476476 RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
477477 # Breaks fcgi etc. Needs constraining to dirs where needed if used
478478 #RewriteRule . /index.php [L]
479479
480480</VirtualHost >
481+ # vim: ft=apache ts=4 sw=4 sts=4 sr et
0 commit comments