Skip to content

Commit 5c220e0

Browse files
committed
reorganize/update cc-legal-tools apache config section
1 parent aa94d17 commit 5c220e0

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

config/web-sites-available/000-default.conf

+18-9
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ ServerName localhost:8080
5353
<Directory /var/www/git/cc-legal-tools-data/docs>
5454
# Disable .htaccess (for security and performance)
5555
AllowOverride None
56+
# Enable CORS (cross-origin resource sharing)
57+
Header set Access-Control-Allow-Origin "*"
58+
# Correct mimetype for .../rdf files
59+
RewriteRule (.*/rdf$) $1 [T=application/rdf+xml]
60+
# Language redirects
61+
Include /var/www/git/cc-legal-tools-data/config/language-redirects
5662
# Also serve HTML files without .html extension
5763
RewriteCond %{REQUEST_FILENAME}.html -f
5864
RewriteRule !.*\.html$ %{REQUEST_FILENAME}.html [L]
@@ -62,16 +68,19 @@ ServerName localhost:8080
6268
RewriteRule (.*/)index\.php$ $1 [L,NC,R=301]
6369
# Deny access to PHP files (content should be only static files)
6470
RewriteRule .*\.php$ "-" [F,L]
65-
# Correct mimetype for .../rdf files
66-
RewriteRule (.*/rdf$) $1 [T=application/rdf+xml]
67-
# Enable CORS (cross-origin resource sharing)
68-
Header set Access-Control-Allow-Origin "*"
6971
</Directory>
70-
Include /var/www/git/cc-legal-tools-data/config/language-redirects
71-
RedirectPermanent /licenses/work-html-popup /choose
72-
RedirectPermanent /licenses/publicdomain/ /publicdomain/
73-
RedirectPermanent /licenses/mark/1.0 /publicdomain/mark/1.0
74-
RedirectPermanent /licences /licenses
72+
# Legacy/compatibilty redirects
73+
RedirectPermanent /licenses/work-html-popup /choose
74+
RedirectPermanent /licences /licenses
75+
# Redirect legacy public domain URLs
76+
RedirectPermanent /licenses/publicdomain/ /publicdomain/
77+
RedirectPermanent /licenses/mark/1.0 /publicdomain/mark/1.0
78+
# Licenses 1.0 has reverse ordered components
79+
RedirectPermanent /licenses/nc-nd/1.0 /licenses/nd-nc/1.0
80+
RedirectPermanent /licenses/by-nc-nd/1.0 /licenses/by-nd-nc/1.0
81+
# Licenses 2.1 only includes ports
82+
RedirectMatch /licenses/([^/]+)/2.1/(lega.*) /licenses/$1/2.0/$2
83+
RedirectMatch /licenses/([^/]+)/2.1/(deed.*) /licenses/$1/2.0/$2
7584

7685
###########################################################################
7786
# Chooser

0 commit comments

Comments
 (0)