Skip to content

Commit

Permalink
remove lowercase redirect and update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
TimidRobot committed May 23, 2024
1 parent caf59bf commit 4851be4
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions config/language-redirects
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,14 @@
# This file was generated by the publish command.
# https://github.com/creativecommons/cc-legal-tools-app
#
# It should be included from within an Apache2 httpd site config
#
# https://httpd.apache.org/docs/2.4/mod/mod_alias.html
# https://httpd.apache.org/docs/2.4/mod/mod_rewrite.html

###############################################################################
# Step 1: Redirect mixed/uppercase to lowercase
#
# Must be set within virtual host context:
RewriteMap lowercase int:tolower
RewriteCond %{REQUEST_URI} ^/(licenses|publicdomain)
RewriteCond $1 [A-Z]
RewriteRule ^/?(.*)$ /${lowercase:$1} [R=301,L]
# See related Apache2 httpd documentation:
# - https://httpd.apache.org/docs/2.4/mod/mod_alias.html
# - https://httpd.apache.org/docs/2.4/mod/mod_rewrite.html

###############################################################################
# Step 2: Redirect alternate language codes to supported Django language codes
# Step 1: Langauge redirects
# - Redirect alternate language codes to supported Django language codes
# - Redirect legacy bug URLs to valid URLs

RedirectMatch 301 "^/publicdomain/zero/1[.]0/legalcode[.]zh[@_-]tw(?:[.]html)?$" "/publicdomain/zero/1.0/legalcode.zh-hant"
RedirectMatch 301 "^/publicdomain/zero/1[.]0/legalcode[.]zh[@_-]cn(?:[.]html)?$" "/publicdomain/zero/1.0/legalcode.zh-hans"
Expand Down

0 comments on commit 4851be4

Please sign in to comment.