From 6f8fdae7c508c31628330d9fb5f0a690ac62dcdb Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Tue, 24 Mar 2026 16:11:55 +0700 Subject: [PATCH 01/38] fix: .htaccess for including in the URL * From rubber-ducky with MD --- .htaccess | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.htaccess b/.htaccess index 05cecb6d..1d5f1882 100644 --- a/.htaccess +++ b/.htaccess @@ -32,6 +32,11 @@ RewriteRule ^crowdin.yml$ = [F,L] # apple-app-site-association RewriteRule "^.well-known/apple-app-site-association$" "/.well-known/apple-app-site-association.json" [L] +# Rewrite //... ignoring known 2-3 letter folders +#RewriteCond "$1" !-f +#RewriteCond "$1" !-d +#RewriteRule "^/(?!cdn|go|mac|web)/(.+)?/" "/_content/$2?lang=$1" + # macosx and macos to mac (ignore case) RewriteRule "^(macosx|macos)\b(.*)$" "/mac$2" [NC,R=301,END,QSA] @@ -180,8 +185,17 @@ RedirectMatch "^/(french|german|italian|spanish|swedish)(/?)$" "/keyboards # dedicated-keyboard-landing pages RedirectMatch 301 "^/(amharic|burmese|cameroon|ethiopic|eurolatin|greek|ipa|sinhala|tamil|tibetan|tigrigna|urdu)(/.*)?$" "/keyboards/h/$1$2" + # -# PHP and Markdown rewriting +# if $1 is a folder or file in /_content, then redirect to currentlang (en?) +# e.g. would redirect windows/download --> en/windows/download/ +RewriteCond "{$DOCUMENT_ROOT}/_content/$1.php" -f +RewriteRule "^(.+)" "en/$1" [R,L] + +# TODO: do we want en/lao --> en/keyboards/basic_kbdlao? as well as /lao --> ... + +# +# PHP and Markdown redirections # # Remove index or index.php and redirect (and stop processing) @@ -200,14 +214,15 @@ RewriteCond "{DOCUMENT_ROOT}/$1.md" !-f RewriteRule "^(.+[^/])$" "$1/" [R,END] # -# PHP rewriting +# PHP and Markdown rewriting # # TODO: mdhost currently in a different path than help.keyman # Rewrite file to file.md -RewriteCond "%{DOCUMENT_ROOT}/$1.md" -f -RewriteRule "^(.+)$" "/_includes/includes/md/mdhost.php?file=$1.md" [END] +RewriteCond "%{DOCUMENT_ROOT}/_content/$2.md" -f +# en --> should be a bcp-47 type 'lang' match (e.g. ab[-x][-y]) ignore case, keep it a fairly loose expression [a-z][a-z][a-z]?(-...)? +RewriteRule "^(en)/(.+)$" "/_includes/includes/md/mdhost.php?file=_content/$2.md&lang=$1" [END] # Rewrite file to file.php RewriteCond "%{DOCUMENT_ROOT}/$1.php" -f From 863f677d3c3566117dfba11203639dc6b6393e30 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Wed, 25 Mar 2026 15:40:19 +0700 Subject: [PATCH 02/38] fix: more rewrites involving _content --- .htaccess | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.htaccess b/.htaccess index 1d5f1882..1ecd9321 100644 --- a/.htaccess +++ b/.htaccess @@ -219,24 +219,25 @@ RewriteRule "^(.+[^/])$" "$1/" [R,END] # TODO: mdhost currently in a different path than help.keyman +# TODO: en --> should be a bcp-47 type 'lang' match (e.g. ab[-x][-y]) ignore case, keep it a fairly loose expression [a-z][a-z][a-z]?(-...)? + # Rewrite file to file.md RewriteCond "%{DOCUMENT_ROOT}/_content/$2.md" -f -# en --> should be a bcp-47 type 'lang' match (e.g. ab[-x][-y]) ignore case, keep it a fairly loose expression [a-z][a-z][a-z]?(-...)? RewriteRule "^(en)/(.+)$" "/_includes/includes/md/mdhost.php?file=_content/$2.md&lang=$1" [END] # Rewrite file to file.php -RewriteCond "%{DOCUMENT_ROOT}/$1.php" -f -RewriteCond "%{DOCUMENT_ROOT}/$1.md" !-f -RewriteRule "^(.+)$" "$1.php" [END] +RewriteCond "%{DOCUMENT_ROOT}/_content/$2.php" -f +RewriteCond "%{DOCUMENT_ROOT}/_content/$2.md" !-f +RewriteRule "^(en)/(.+)$" "/_content/$2.php?lang=$1" [END] # Rewrite folder/ to folder/index.md -RewriteCond "%{DOCUMENT_ROOT}/$1/index.md" -f -RewriteRule "^(.+)/$" "/_includes/includes/md/mdhost.php?file=$1/index.md" [END] +RewriteCond "%{DOCUMENT_ROOT}/_content/$2/index.md" -f +RewriteRule "^(en)/(.+)/$" "/_includes/includes/md/mdhost.php?file=_content/$2/index.md&lang=$1" [END] # Rewrite folder/ to folder/index.php -RewriteCond "%{DOCUMENT_ROOT}/$1/index.php" -f -RewriteCond "%{DOCUMENT_ROOT}/$1/index.md" !-f -RewriteRule "^(.+)/$" "$1/index.php" [END] +RewriteCond "%{DOCUMENT_ROOT}/_content/$2/index.php" -f +RewriteCond "%{DOCUMENT_ROOT}/_content/$2/index.md" !-f +RewriteRule "^(en)/(.+)/$" "/_content/$2/index.php?lang=$1" [END] # Finally, append the terminating slash for folders, given it is no longer # done automatically because we put DirectorySlash off From d98b2366236b953f1ee974ddf5c72b81a34514cf Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Tue, 31 Mar 2026 06:44:24 +0700 Subject: [PATCH 03/38] fix: Add lang to Head.php --- _includes/2020/templates/Head.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/_includes/2020/templates/Head.php b/_includes/2020/templates/Head.php index e5c7f134..c01aa379 100644 --- a/_includes/2020/templates/Head.php +++ b/_includes/2020/templates/Head.php @@ -31,6 +31,11 @@ static function render($fields = []) { if(!isset($fields->js)) { $fields->js = []; } + + // Fallback to 'en' + // TODO-I18N-URL-SCHEME: integrate with Locale.php + $fields->lang = isset($_REQUEST['lang']) ? $_REQUEST['lang'] : 'en'; + ?> language)) { From f4d6d99730733d4178f4db415940b64b79ff75e1 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Tue, 31 Mar 2026 10:32:38 +0700 Subject: [PATCH 04/38] fix: redirects to currentlang --- .htaccess | 11 +++++------ _content/developer/index.php | 6 +++--- _content/developer/keymanweb/index.php | 10 +++++----- _content/downloads/index.php | 2 +- _content/windows/index.php | 2 +- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.htaccess b/.htaccess index 1ecd9321..752a1ee0 100644 --- a/.htaccess +++ b/.htaccess @@ -33,9 +33,9 @@ RewriteRule ^crowdin.yml$ = [F,L] RewriteRule "^.well-known/apple-app-site-association$" "/.well-known/apple-app-site-association.json" [L] # Rewrite //... ignoring known 2-3 letter folders -#RewriteCond "$1" !-f -#RewriteCond "$1" !-d -#RewriteRule "^/(?!cdn|go|mac|web)/(.+)?/" "/_content/$2?lang=$1" +RewriteCond "$1" !-f +RewriteCond "$1" !-d +RewriteRule "^/(?!cdn|go|mac|web)/(.+)?/" "/_content/$2?lang=$1" # macosx and macos to mac (ignore case) RewriteRule "^(macosx|macos)\b(.*)$" "/mac$2" [NC,R=301,END,QSA] @@ -185,7 +185,6 @@ RedirectMatch "^/(french|german|italian|spanish|swedish)(/?)$" "/keyboards # dedicated-keyboard-landing pages RedirectMatch 301 "^/(amharic|burmese|cameroon|ethiopic|eurolatin|greek|ipa|sinhala|tamil|tibetan|tigrigna|urdu)(/.*)?$" "/keyboards/h/$1$2" - # # if $1 is a folder or file in /_content, then redirect to currentlang (en?) # e.g. would redirect windows/download --> en/windows/download/ @@ -241,7 +240,7 @@ RewriteRule "^(en)/(.+)/$" "/_content/$2/index.php?lang=$1" [END] # Finally, append the terminating slash for folders, given it is no longer # done automatically because we put DirectorySlash off -RewriteCond %{REQUEST_FILENAME} -d -RewriteRule "^(.*)([^/])$" "$1$2/" [R] +RewriteCond "%{DOCUMENT_ROOT}/_content/$2$3" -d +RewriteRule "^(en)(.*)([^/])$" "$1$2$3/" [R,QSA] diff --git a/_content/developer/index.php b/_content/developer/index.php index c44079ed..f2cf45be 100644 --- a/_content/developer/index.php +++ b/_content/developer/index.php @@ -17,14 +17,14 @@ ?>

Keyman Developer

-

Keyman Developer is the most powerful tool for creating +

Keyman Developer is the most powerful tool for creating keyboard layouts for any popular platform for any language around the world. Build keyboards layouts for desktop, web, tablet and phone. Optimise your keyboards for each platform, including touch-and-hold keys and alternative layers.

diff --git a/_content/developer/keymanweb/index.php b/_content/developer/keymanweb/index.php index eb817d20..d165cb72 100644 --- a/_content/developer/keymanweb/index.php +++ b/_content/developer/keymanweb/index.php @@ -19,7 +19,7 @@

KeymanWeb Source Code and Development

KeymanWeb is an Open Source input method system for the web, supporting both desktops and touch devices. Keyboard layouts for - use with KeymanWeb can be created with the free download Keyman Developer (Windows). + use with KeymanWeb can be created with the free download Keyman Developer (Windows).

Add KeymanWeb to a Website

@@ -45,11 +45,11 @@ @@ -97,9 +97,9 @@

diff --git a/_content/downloads/index.php b/_content/downloads/index.php index d50cb2d8..09c4ea09 100644 --- a/_content/downloads/index.php +++ b/_content/downloads/index.php @@ -29,5 +29,5 @@ diff --git a/_content/windows/index.php b/_content/windows/index.php index f7a120bd..54d452ee 100644 --- a/_content/windows/index.php +++ b/_content/windows/index.php @@ -10,7 +10,7 @@ 'showMenu' => true, 'banner' => [ 'title' => 'Keyman '.$stable_version.' for Windows
Type in your language', - 'button' => '', + 'button' => '', 'image' => 'screenshots/14/windows/osk-malayalam-566x226.png', 'background' => 'water' ] From 91d69b59f6cf9c9dd37682627e152b666bba5bf7 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Tue, 31 Mar 2026 14:26:12 +0700 Subject: [PATCH 05/38] fix: remove .php from links --- .htaccess | 3 ++ _content/archive/.htaccess | 3 -- _content/keyboards/h/tigrigna/index.php | 4 +-- _content/linux/index.php | 4 +-- _content/mac/index.php | 4 +-- _content/windows/index.php | 38 +++++++++++------------ _includes/includes/developer-features.php | 2 +- 7 files changed, 29 insertions(+), 29 deletions(-) delete mode 100644 _content/archive/.htaccess diff --git a/.htaccess b/.htaccess index 752a1ee0..7e7887ac 100644 --- a/.htaccess +++ b/.htaccess @@ -32,6 +32,9 @@ RewriteRule ^crowdin.yml$ = [F,L] # apple-app-site-association RewriteRule "^.well-known/apple-app-site-association$" "/.well-known/apple-app-site-association.json" [L] +# Redirect /archive/downloads.php" +RewriteRule "^(archive)/(downloads)(\.php)?$" "en/$2/$1/" [NC,R=301,QSA] + # Rewrite //... ignoring known 2-3 letter folders RewriteCond "$1" !-f RewriteCond "$1" !-d diff --git a/_content/archive/.htaccess b/_content/archive/.htaccess deleted file mode 100644 index 0599591b..00000000 --- a/_content/archive/.htaccess +++ /dev/null @@ -1,3 +0,0 @@ - -# Redirect /archive/downloads.php" -RedirectMatch 301 "/archive/downloads.php" "/downloads/archive/" diff --git a/_content/keyboards/h/tigrigna/index.php b/_content/keyboards/h/tigrigna/index.php index a11b8b32..4f6838d5 100644 --- a/_content/keyboards/h/tigrigna/index.php +++ b/_content/keyboards/h/tigrigna/index.php @@ -16,7 +16,7 @@ Type in Tigrigna on iPhone, iPad, Windows, macOS, Linux, and Android. Our Tigrigna keyboards works with Microsoft Word, Photoshop, Facebook, Twitter, email and thousands of other applications.

- Click here for Tigirigna (Eritrea) + Click here for Tigirigna (Eritrea)

@@ -115,7 +115,7 @@

Type in other Ethiopic languages such as:

\ No newline at end of file From cd9fd452aa011c80123b14ed2c8e9bef0e5ab124 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Wed, 1 Apr 2026 10:44:50 +0700 Subject: [PATCH 06/38] tweak regex --- .htaccess | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.htaccess b/.htaccess index 7e7887ac..adcb594c 100644 --- a/.htaccess +++ b/.htaccess @@ -38,7 +38,7 @@ RewriteRule "^(archive)/(downloads)(\.php)?$" "en/$2/$1/" [NC,R=301,QSA] # Rewrite //... ignoring known 2-3 letter folders RewriteCond "$1" !-f RewriteCond "$1" !-d -RewriteRule "^/(?!cdn|go|mac|web)/(.+)?/" "/_content/$2?lang=$1" +RewriteRule "^(?!cdn|go|mac|web)([^/]+)/(.+)$" "/_content/$2?lang=$1" # macosx and macos to mac (ignore case) RewriteRule "^(macosx|macos)\b(.*)$" "/mac$2" [NC,R=301,END,QSA] From a0f3d869949c3926a7326cb02aead8012123c2fa Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Thu, 2 Apr 2026 09:40:48 +0700 Subject: [PATCH 07/38] fix 404 --- .htaccess | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.htaccess b/.htaccess index 15d1bd1b..b372d569 100644 --- a/.htaccess +++ b/.htaccess @@ -24,10 +24,10 @@ RewriteBase / AddType application/json apple-app-site-association # Deny crowdin.yml -RewriteRule ^crowdin.yml$ = [F,L] +RewriteRule "^crowdin.yml$" = [F,L] # Custom error messages (need to pass the original request) -ErrorDocument 404 /_includes/errors/404 +ErrorDocument 404 /_includes/errors/404.php # apple-app-site-association RewriteRule "^.well-known/apple-app-site-association$" "/.well-known/apple-app-site-association.json" [L] @@ -204,10 +204,10 @@ RewriteRule "^(.+)" "en/$1" [R,L] RewriteCond "$1" -d RewriteRule "^((.+)/)?index(\.php)?$" "$1" [R,L] -# Remove .php extension and redirect +# Remove .php extension and redirect (except for 404) RewriteCond "$1.php" -f RewriteCond "$1" !-d -RewriteRule "^(.+)\.php$" "$1" [R,L] +RewriteRule "^(.+)?!404\.php$" "$1" [R,L] # Redirect folder without / to include / RewriteCond "{DOCUMENT_ROOT}/$1" -d From 3804817437854ee784620e366f4c61989895a19f Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Thu, 2 Apr 2026 11:29:33 +0700 Subject: [PATCH 08/38] fix en routing --- .htaccess | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.htaccess b/.htaccess index b372d569..2ca57ebe 100644 --- a/.htaccess +++ b/.htaccess @@ -36,9 +36,9 @@ RewriteRule "^.well-known/apple-app-site-association$" "/.well-known/apple-app-s RewriteRule "^(archive)/(downloads)(\.php)?$" "en/$2/$1/" [NC,R=301,QSA] # Rewrite //... ignoring known 2-3 letter folders -RewriteCond "$1" !-f -RewriteCond "$1" !-d -RewriteRule "^(?!cdn|go|mac|web)([^/]+)/(.+)$" "/_content/$2?lang=$1" +#RewriteCond "$1" !-f +#RewriteCond "$1" !-d +#RewriteRule "^(?!cdn|go|mac|web)([^/]+)/(.+)$" "/_content/$2?lang=$1" # macosx and macos to mac (ignore case) RewriteRule "^(macosx|macos)\b(.*)$" "/mac$2" [NC,R=301,END,QSA] @@ -191,8 +191,10 @@ RedirectMatch 301 "^/(amharic|burmese|cameroon|ethiopic|eurolatin|greek|ipa|sinh # # if $1 is a folder or file in /_content, then redirect to currentlang (en?) # e.g. would redirect windows/download --> en/windows/download/ -RewriteCond "{$DOCUMENT_ROOT}/_content/$1.php" -f -RewriteRule "^(.+)" "en/$1" [R,L] +RewriteCond "%{DOCUMENT_ROOT}/_content/$1.php" -f [OR] +RewriteCond "%{DOCUMENT_ROOT}/_content/$1.md" -f [OR] +RewriteCond "%{DOCUMENT_ROOT}/_content/$1" -d +RewriteRule "^(.+)$" "en/$1" [R,L] # TODO: do we want en/lao --> en/keyboards/basic_kbdlao? as well as /lao --> ... @@ -222,6 +224,10 @@ RewriteRule "^(.+[^/])$" "$1/" [R,END] # TODO: mdhost currently in a different path than help.keyman # TODO: en --> should be a bcp-47 type 'lang' match (e.g. ab[-x][-y]) ignore case, keep it a fairly loose expression [a-z][a-z][a-z]?(-...)? +############################################## + +# root +RewriteRule "^/?$" "/_content/" [END,QSA] # Rewrite file to file.md RewriteCond "%{DOCUMENT_ROOT}/_content/$2.md" -f From 839fb40ad7171db6f7fcd0c1f93b5a3f4285be60 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Thu, 2 Apr 2026 13:50:21 +0700 Subject: [PATCH 09/38] fix: Handle _control, go, and _test * These folders don't use _content --- .htaccess | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.htaccess b/.htaccess index 2ca57ebe..1ef5e938 100644 --- a/.htaccess +++ b/.htaccess @@ -188,6 +188,18 @@ RedirectMatch "^/(french|german|italian|spanish|swedish)(/?)$" "/keyboards # dedicated-keyboard-landing pages RedirectMatch 301 "^/(amharic|burmese|cameroon|ethiopic|eurolatin|greek|ipa|sinhala|tamil|tibetan|tigrigna|urdu)(/.*)?$" "/keyboards/h/$1$2" +# No i18n for _control and go pages - won't go to _content +RewriteCond "%{DOCUMENT_ROOT}/$1/$2.php" -f +RewriteRule "^(_control|go)/(.+)$" "/$1/$2.php" [END] + +# No i18n for _test infrastructure pages - won't go to _content +RewriteCond "%{DOCUMENT_ROOT}/$1/$2.md" -f +RewriteRule "^(_test)/(.+)$" "/_includes/includes/md/mdhost.php?file=$1/$2.md" [END] + +RewriteCond "%{DOCUMENT_ROOT}/$1/index.md" -f +RewriteRule "^(_test)/?$" "/_includes/includes/md/mdhost.php?file=$1/index.md" [END] + + # # if $1 is a folder or file in /_content, then redirect to currentlang (en?) # e.g. would redirect windows/download --> en/windows/download/ @@ -224,6 +236,7 @@ RewriteRule "^(.+[^/])$" "$1/" [R,END] # TODO: mdhost currently in a different path than help.keyman # TODO: en --> should be a bcp-47 type 'lang' match (e.g. ab[-x][-y]) ignore case, keep it a fairly loose expression [a-z][a-z][a-z]?(-...)? + ############################################## # root From 1583b34f7f1d470fbdcac631c7b5309d35c93972 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Thu, 2 Apr 2026 14:52:20 +0700 Subject: [PATCH 10/38] refactor: reorder .htaccess 1. remove .php / .md 2. redirects before rewrites 3. rewrite locale to lang= parameter 4. final cleanup --- .htaccess | 187 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 107 insertions(+), 80 deletions(-) diff --git a/.htaccess b/.htaccess index 1ef5e938..ac175036 100644 --- a/.htaccess +++ b/.htaccess @@ -27,11 +27,38 @@ AddType application/json apple-app-site-association RewriteRule "^crowdin.yml$" = [F,L] # Custom error messages (need to pass the original request) -ErrorDocument 404 /_includes/errors/404.php +# ErrorDocument 404 /_includes/errors/404.php Add this back # apple-app-site-association RewriteRule "^.well-known/apple-app-site-association$" "/.well-known/apple-app-site-association.json" [L] +# ################################################################## +# Redirections - before rewriting +# ################################################################## + +# ------------------------------------------------------------------ +# PHP and Markdown redirections +# ------------------------------------------------------------------ + +# Remove index or index.php and redirect (and stop processing) +RewriteCond "$1" -d +RewriteRule "^((.+)/)?index(\.php)?$" "$1" [R,L] + +# Remove .php extension and redirect (except for 404) +RewriteCond "$1.php" -f +RewriteCond "$1" !-d +RewriteRule "^(.+)(?!404)\.php$" "$1" [R,L] + +# Redirect folder without / to include / +RewriteCond "{DOCUMENT_ROOT}/$1" -d +RewriteCond "{DOCUMENT_ROOT}/$1.php" !-f +RewriteCond "{DOCUMENT_ROOT}/$1.md" !-f +RewriteRule "^(.+[^/])$" "$1/" [R,END] + +# ------------------------------------------------------------------ +# Known path redirections +# ------------------------------------------------------------------ + # Redirect /archive/downloads.php" RewriteRule "^(archive)/(downloads)(\.php)?$" "en/$2/$1/" [NC,R=301,QSA] @@ -58,13 +85,6 @@ RedirectMatch 301 "^(?i)/privacy(\/.*)?" "https://software.sil.org/language-soft # desktop to windows RewriteRule "^desktop(/.*)?" "/windows$1" [NC,R=301,END,QSA] -# releases-tier/download -# note: the tier is currently ignored -RewriteRule "^downloads/releases/(alpha|beta|stable)/(.+)$" "/downloads/releases/_version_downloads.php?tier=$1&version=$2" [END] - -# releases-download -RewriteRule "^downloads/releases/(.+)$" "/downloads/releases/_version_downloads.php?version=$1" [END] - # index RewriteRule "^downloads/releases(\/)?$" "/downloads" [R,END] @@ -94,48 +114,6 @@ RewriteRule "^keyboards/(.*)/share(/?)$" "/keyboards/share/$1" [R=301] # /keyboard/{content} to /keyboards/... RewriteRule "^keyboard(/.*)$" "/keyboards$1" [R,END] -# -# Install | Download | Share | bare | .json --> -# - -# /keyboards/install/[id] to /keyboards/install.php -RewriteRule "^keyboards/install/([^/]+)$" "/keyboards/install.php?id=$1" [END,QSA] - -# /keyboards/download/[id] to /keyboards/keyboard.php -# This formerly redirected to a download, but we no longer need it; keep it for -# legacy links -RewriteRule "^keyboards/download/([^/]+)$" "/keyboards/keyboard.php?id=$1" [END,QSA] - -# /keyboards/share/[id] to /keyboards/share.php -# if the keyboard exists in the repo, then share.php will redirect to /keyboards/ -RewriteRule "^keyboards/share/([^/]+)$" "/keyboards/share.php?id=$1" [END,QSA] - -# /keyboards/{id}.json to /keyboards/keyboard.json.php -RewriteRule "^keyboards/(?!keyboard.json)(.*)\.json$" "/keyboards/keyboard.json.php?id=$1" [END] - -# /keyboards/{id} to /keyboards/keyboard.php -RewriteRule "^keyboards/(?!index\.php|install|keyboard|session|share)([^/]+)$" "/keyboards/keyboard.php?id=$1" [END,QSA] - - -# -# Search -# - -# /keyboards?q=... to /keyboards/index.php -# RewriteRule "^keyboards$" "/keyboards/index.php" [L] - -# /keyboards/languages to /keyboards/index.php -RewriteRule "^keyboards/languages/(.*)" "/keyboards/index.php?q=l:id:$1" [END,QSA] - -# /keyboards/download to /keyboards/download.php -RewriteRule "^keyboards/download(.php)?" "/keyboards/download.php" [END,QSA] - -# /keyboards/legacy to /keyboards/keyboard.php -RewriteRule "^keyboards/legacy/(.*)" "/keyboards/keyboard.php?legacy=$1" [END] - -# /keyboards/countries to /keyboards/index.php -RewriteRule "^keyboards/countries/(.*)" "/keyboards/index.php?q=c:id:$1" [END] - # Synonym paths # 10.0 to 15.0 @@ -188,46 +166,94 @@ RedirectMatch "^/(french|german|italian|spanish|swedish)(/?)$" "/keyboards # dedicated-keyboard-landing pages RedirectMatch 301 "^/(amharic|burmese|cameroon|ethiopic|eurolatin|greek|ipa|sinhala|tamil|tibetan|tigrigna|urdu)(/.*)?$" "/keyboards/h/$1$2" -# No i18n for _control and go pages - won't go to _content +# ------------------------------------------------------------------ +# i18n redirect --> /file to /file +# ------------------------------------------------------------------ + +# +# if $1 is a folder or file in /_content, then redirect to currentlang (en?) +# e.g. would redirect windows/download --> en/windows/download/ +RewriteCond "%{DOCUMENT_ROOT}/_content/$1.php" -f [OR] +RewriteCond "%{DOCUMENT_ROOT}/_content/$1.md" -f [OR] +RewriteCond "%{DOCUMENT_ROOT}/_content/$1" -d +RewriteRule "^(.*)$" "en/$1" [R,L] + +# ################################################################## +# Rewriting +# ################################################################## + +# ------------------------------------------------------------------ +# top-level content without i18n - _control/, go/, _test/ +# ------------------------------------------------------------------ + +# No i18n - won't go to _content + RewriteCond "%{DOCUMENT_ROOT}/$1/$2.php" -f -RewriteRule "^(_control|go)/(.+)$" "/$1/$2.php" [END] +RewriteRule "^(_control|go|_test)/(.+)$" "/$1/$2.php" [END] -# No i18n for _test infrastructure pages - won't go to _content RewriteCond "%{DOCUMENT_ROOT}/$1/$2.md" -f -RewriteRule "^(_test)/(.+)$" "/_includes/includes/md/mdhost.php?file=$1/$2.md" [END] +RewriteRule "^(_control|go|_test)/(.+)$" "/_includes/includes/md/mdhost.php?file=$1/$2.md" [END] RewriteCond "%{DOCUMENT_ROOT}/$1/index.md" -f -RewriteRule "^(_test)/?$" "/_includes/includes/md/mdhost.php?file=$1/index.md" [END] +RewriteRule "^(_control|go|_test)/?$" "/_includes/includes/md/mdhost.php?file=$1/index.md" [END] + +# +# keyboards Install | Download | Share | bare | .json --> +# +## inject content and lang 200-250 + + +# /keyboards/install/[id] to /keyboards/install.php +RewriteRule "^keyboards/install/([^/]+)$" "/keyboards/install.php?id=$1" [END,QSA] + +# /keyboards/download/[id] to /keyboards/keyboard.php +# This formerly redirected to a download, but we no longer need it; keep it for +# legacy links +RewriteRule "^keyboards/download/([^/]+)$" "/keyboards/keyboard.php?id=$1" [END,QSA] + +# /keyboards/share/[id] to /keyboards/share.php +# if the keyboard exists in the repo, then share.php will redirect to /keyboards/ +RewriteRule "^keyboards/share/([^/]+)$" "/keyboards/share.php?id=$1" [END,QSA] + +# /keyboards/{id}.json to /keyboards/keyboard.json.php +RewriteRule "^keyboards/(?!keyboard.json)(.*)\.json$" "/keyboards/keyboard.json.php?id=$1" [END] + +# /keyboards/{id} to /keyboards/keyboard.php +RewriteRule "^keyboards/(?!index\.php|install|keyboard|session|share)([^/]+)$" "/keyboards/keyboard.php?id=$1" [END,QSA] # -# if $1 is a folder or file in /_content, then redirect to currentlang (en?) -# e.g. would redirect windows/download --> en/windows/download/ -RewriteCond "%{DOCUMENT_ROOT}/_content/$1.php" -f [OR] -RewriteCond "%{DOCUMENT_ROOT}/_content/$1.md" -f [OR] -RewriteCond "%{DOCUMENT_ROOT}/_content/$1" -d -RewriteRule "^(.+)$" "en/$1" [R,L] +# keyboards search +# -# TODO: do we want en/lao --> en/keyboards/basic_kbdlao? as well as /lao --> ... +# /keyboards?q=... to /keyboards/index.php +# RewriteRule "^keyboards$" "/keyboards/index.php" [L] + +# /keyboards/languages to /keyboards/index.php +RewriteRule "^keyboards/languages/(.*)" "/keyboards/index.php?q=l:id:$1" [END,QSA] + +# /keyboards/download to /keyboards/download.php +RewriteRule "^keyboards/download(.php)?" "/keyboards/download.php" [END,QSA] + +# /keyboards/legacy to /keyboards/keyboard.php +RewriteRule "^keyboards/legacy/(.*)" "/keyboards/keyboard.php?legacy=$1" [END] + +# /keyboards/countries to /keyboards/index.php +RewriteRule "^keyboards/countries/(.*)" "/keyboards/index.php?q=c:id:$1" [END] # -# PHP and Markdown redirections +# downloads/releases # -# Remove index or index.php and redirect (and stop processing) -RewriteCond "$1" -d -RewriteRule "^((.+)/)?index(\.php)?$" "$1" [R,L] +# releases-tier/download +# note: the tier is currently ignored +RewriteRule "^downloads/releases/(alpha|beta|stable)/(.+)$" "/downloads/releases/_version_downloads.php?tier=$1&version=$2" [END] -# Remove .php extension and redirect (except for 404) -RewriteCond "$1.php" -f -RewriteCond "$1" !-d -RewriteRule "^(.+)?!404\.php$" "$1" [R,L] +# releases-download +RewriteRule "^(en)/downloads/releases/(.+)$" "/_content/downloads/releases/_version_downloads.php?version=$2&lang=$1" [END] +RewriteRule "^downloads/releases/(.+)$" "/downloads/releases/_version_downloads.php?version=$1" [END] -# Redirect folder without / to include / -RewriteCond "{DOCUMENT_ROOT}/$1" -d -RewriteCond "{DOCUMENT_ROOT}/$1.php" !-f -RewriteCond "{DOCUMENT_ROOT}/$1.md" !-f -RewriteRule "^(.+[^/])$" "$1/" [R,END] +# TODO: do we want en/lao --> en/keyboards/basic_kbdlao? as well as /lao --> ... # # PHP and Markdown rewriting @@ -239,8 +265,8 @@ RewriteRule "^(.+[^/])$" "$1/" [R,END] ############################################## -# root -RewriteRule "^/?$" "/_content/" [END,QSA] +# root - TODO is this rule needed? surely rule to redirect to/en ## +# RewriteRule "^/?$" "/_content/" [END,QSA] # Rewrite file to file.md RewriteCond "%{DOCUMENT_ROOT}/_content/$2.md" -f @@ -260,9 +286,10 @@ RewriteCond "%{DOCUMENT_ROOT}/_content/$2/index.php" -f RewriteCond "%{DOCUMENT_ROOT}/_content/$2/index.md" !-f RewriteRule "^(en)/(.+)/$" "/_content/$2/index.php?lang=$1" [END] +# Root page +RewriteRule "^(en)/$" "/_content/index.php?lang=$1" [END] + # Finally, append the terminating slash for folders, given it is no longer # done automatically because we put DirectorySlash off RewriteCond "%{DOCUMENT_ROOT}/_content/$2$3" -d -RewriteRule "^(en)(.*)([^/])$" "$1$2$3/" [R,QSA] - - +RewriteRule "^(en)(.*)([^/])?$" "$1$2$3/" [R,QSA] From 7ca0e0171777953bd09f0d37362633fb68906a9a Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Thu, 2 Apr 2026 15:20:57 +0700 Subject: [PATCH 11/38] chore: remove old root rule --- .htaccess | 3 --- 1 file changed, 3 deletions(-) diff --git a/.htaccess b/.htaccess index ac175036..2483a1b9 100644 --- a/.htaccess +++ b/.htaccess @@ -265,9 +265,6 @@ RewriteRule "^downloads/releases/(.+)$" "/downloads/releases/_version_downloads. ############################################## -# root - TODO is this rule needed? surely rule to redirect to/en ## -# RewriteRule "^/?$" "/_content/" [END,QSA] - # Rewrite file to file.md RewriteCond "%{DOCUMENT_ROOT}/_content/$2.md" -f RewriteRule "^(en)/(.+)$" "/_includes/includes/md/mdhost.php?file=_content/$2.md&lang=$1" [END] From 57ad35dbd794c66c363ccdc12b36c74003faeee1 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Thu, 2 Apr 2026 15:21:13 +0700 Subject: [PATCH 12/38] fix: downloads/releases paths --- .htaccess | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.htaccess b/.htaccess index 2483a1b9..8f6dccf4 100644 --- a/.htaccess +++ b/.htaccess @@ -178,6 +178,9 @@ RewriteCond "%{DOCUMENT_ROOT}/_content/$1.md" -f [OR] RewriteCond "%{DOCUMENT_ROOT}/_content/$1" -d RewriteRule "^(.*)$" "en/$1" [R,L] +# downloads/releases (tier & version params) +RewriteRule "^(downloads\/releases)/(.+)$" "en/$1/$2" [R,L] + # ################################################################## # Rewriting # ################################################################## @@ -247,11 +250,10 @@ RewriteRule "^keyboards/countries/(.*)" "/keyboards/index.php?q=c:id:$1" [END] # releases-tier/download # note: the tier is currently ignored -RewriteRule "^downloads/releases/(alpha|beta|stable)/(.+)$" "/downloads/releases/_version_downloads.php?tier=$1&version=$2" [END] +RewriteRule "^(en)/downloads/releases/(alpha|beta|stable)/(.+)$" "/_content/downloads/releases/_version_downloads.php?tier=$2&version=$3&lang=$1" [END] # releases-download RewriteRule "^(en)/downloads/releases/(.+)$" "/_content/downloads/releases/_version_downloads.php?version=$2&lang=$1" [END] -RewriteRule "^downloads/releases/(.+)$" "/downloads/releases/_version_downloads.php?version=$1" [END] # TODO: do we want en/lao --> en/keyboards/basic_kbdlao? as well as /lao --> ... From 37273da8785607bf5e5b7b9d8dc9d4fa5915ba76 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Thu, 2 Apr 2026 16:00:16 +0700 Subject: [PATCH 13/38] fix: keyboard rewrites --- .htaccess | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/.htaccess b/.htaccess index 8f6dccf4..6df6167f 100644 --- a/.htaccess +++ b/.htaccess @@ -178,8 +178,9 @@ RewriteCond "%{DOCUMENT_ROOT}/_content/$1.md" -f [OR] RewriteCond "%{DOCUMENT_ROOT}/_content/$1" -d RewriteRule "^(.*)$" "en/$1" [R,L] -# downloads/releases (tier & version params) -RewriteRule "^(downloads\/releases)/(.+)$" "en/$1/$2" [R,L] +# +# Paths involving queries (don't match on file/directory) +RewriteRule "^(downloads\/releases|keyboards)/(.+)$" "en/$1/$2" [R,L] # ################################################################## # Rewriting @@ -204,45 +205,39 @@ RewriteRule "^(_control|go|_test)/?$" "/_includes/includes/md/mdhost.php?file=$1 # keyboards Install | Download | Share | bare | .json --> # -## inject content and lang 200-250 - - # /keyboards/install/[id] to /keyboards/install.php -RewriteRule "^keyboards/install/([^/]+)$" "/keyboards/install.php?id=$1" [END,QSA] +RewriteRule "^(en)/keyboards/install/([^/]+)$" "/_content/keyboards/install.php?id=$2&lang=$1" [END,QSA] # /keyboards/download/[id] to /keyboards/keyboard.php # This formerly redirected to a download, but we no longer need it; keep it for # legacy links -RewriteRule "^keyboards/download/([^/]+)$" "/keyboards/keyboard.php?id=$1" [END,QSA] +RewriteRule "^(en)/keyboards/download/([^/]+)$" "/_content/keyboards/keyboard.php?id=$2&lang=$1" [END,QSA] # /keyboards/share/[id] to /keyboards/share.php # if the keyboard exists in the repo, then share.php will redirect to /keyboards/ -RewriteRule "^keyboards/share/([^/]+)$" "/keyboards/share.php?id=$1" [END,QSA] +RewriteRule "^(en)/keyboards/share/([^/]+)$" "/_content/keyboards/share.php?id=$2&lang=$1" [END,QSA] # /keyboards/{id}.json to /keyboards/keyboard.json.php -RewriteRule "^keyboards/(?!keyboard.json)(.*)\.json$" "/keyboards/keyboard.json.php?id=$1" [END] +RewriteRule "^(en)/keyboards/(?!keyboard.json)(.*)\.json$" "/_content/keyboards/keyboard.json.php?id=$2&lang=$1" [END] # /keyboards/{id} to /keyboards/keyboard.php -RewriteRule "^keyboards/(?!index\.php|install|keyboard|session|share)([^/]+)$" "/keyboards/keyboard.php?id=$1" [END,QSA] +RewriteRule "^(en)/keyboards/(?!index\.php|install|keyboard|session|share)([^/]+)$" "/_content/keyboards/keyboard.php?id=$2&lang=$1" [END,QSA] # # keyboards search # -# /keyboards?q=... to /keyboards/index.php -# RewriteRule "^keyboards$" "/keyboards/index.php" [L] - # /keyboards/languages to /keyboards/index.php -RewriteRule "^keyboards/languages/(.*)" "/keyboards/index.php?q=l:id:$1" [END,QSA] +RewriteRule "^(en)/keyboards/languages/(.*)" "/_content/keyboards/index.php?q=l:id:$2&lang=$1" [END,QSA] # /keyboards/download to /keyboards/download.php -RewriteRule "^keyboards/download(.php)?" "/keyboards/download.php" [END,QSA] +RewriteRule "^(en)/keyboards/download(.php)?" "/_content/keyboards/download.php&lang=$1" [END,QSA] # /keyboards/legacy to /keyboards/keyboard.php -RewriteRule "^keyboards/legacy/(.*)" "/keyboards/keyboard.php?legacy=$1" [END] +RewriteRule "^(en)/keyboards/legacy/(.*)" "/_content/keyboards/keyboard.php?legacy=$2&lang=$1" [END] # /keyboards/countries to /keyboards/index.php -RewriteRule "^keyboards/countries/(.*)" "/keyboards/index.php?q=c:id:$1" [END] +RewriteRule "^(en)/keyboards/countries/(.*)" "/_content/keyboards/index.php?q=c:id:$2&lang=$1" [END] # # downloads/releases From 95bbf294a70b06fd0ff9a9235d35adc6db812faa Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Thu, 2 Apr 2026 16:00:28 +0700 Subject: [PATCH 14/38] chore: more cleanup --- .htaccess | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.htaccess b/.htaccess index 6df6167f..37b1b83e 100644 --- a/.htaccess +++ b/.htaccess @@ -60,7 +60,7 @@ RewriteRule "^(.+[^/])$" "$1/" [R,END] # ------------------------------------------------------------------ # Redirect /archive/downloads.php" -RewriteRule "^(archive)/(downloads)(\.php)?$" "en/$2/$1/" [NC,R=301,QSA] +RewriteRule "^archive/downloads(\.php)?$" "/archive/downloads/" [NC,R=301,QSA] # Rewrite //... ignoring known 2-3 letter folders #RewriteCond "$1" !-f @@ -85,7 +85,7 @@ RedirectMatch 301 "^(?i)/privacy(\/.*)?" "https://software.sil.org/language-soft # desktop to windows RewriteRule "^desktop(/.*)?" "/windows$1" [NC,R=301,END,QSA] -# index +# releases-download index RewriteRule "^downloads/releases(\/)?$" "/downloads" [R,END] # CLDR -> LDML From bf9897ec80595055cda08bc1843cef93b062435e Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Mon, 6 Apr 2026 08:07:13 +0700 Subject: [PATCH 15/38] fix /archive/downloads redirect --- .htaccess | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.htaccess b/.htaccess index 37b1b83e..1902c8e9 100644 --- a/.htaccess +++ b/.htaccess @@ -60,12 +60,7 @@ RewriteRule "^(.+[^/])$" "$1/" [R,END] # ------------------------------------------------------------------ # Redirect /archive/downloads.php" -RewriteRule "^archive/downloads(\.php)?$" "/archive/downloads/" [NC,R=301,QSA] - -# Rewrite //... ignoring known 2-3 letter folders -#RewriteCond "$1" !-f -#RewriteCond "$1" !-d -#RewriteRule "^(?!cdn|go|mac|web)([^/]+)/(.+)$" "/_content/$2?lang=$1" +RewriteRule "^archive/downloads(.php)?$" "/downloads/archive/" [NC,R=301,QSA] # macosx and macos to mac (ignore case) RewriteRule "^(macosx|macos)\b(.*)$" "/mac$2" [NC,R=301,END,QSA] From 7634f84bb5a40b886fb22ec2cfcadb9427063a70 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Mon, 6 Apr 2026 09:36:26 +0700 Subject: [PATCH 16/38] fix: keyboards/download query --- .htaccess | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.htaccess b/.htaccess index 1902c8e9..4971530a 100644 --- a/.htaccess +++ b/.htaccess @@ -226,7 +226,7 @@ RewriteRule "^(en)/keyboards/(?!index\.php|install|keyboard|session|share)([^/]+ RewriteRule "^(en)/keyboards/languages/(.*)" "/_content/keyboards/index.php?q=l:id:$2&lang=$1" [END,QSA] # /keyboards/download to /keyboards/download.php -RewriteRule "^(en)/keyboards/download(.php)?" "/_content/keyboards/download.php&lang=$1" [END,QSA] +RewriteRule "^(en)/keyboards/download(.php)?" "/_content/keyboards/download.php?lang=$1" [END,QSA] # /keyboards/legacy to /keyboards/keyboard.php RewriteRule "^(en)/keyboards/legacy/(.*)" "/_content/keyboards/keyboard.php?legacy=$2&lang=$1" [END] From 93bad374c4333a87ff792312328af5b9db3aa182 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Mon, 6 Apr 2026 09:37:03 +0700 Subject: [PATCH 17/38] fix /contact/exception also cleaned up test pages --- .htaccess | 11 +++++++++++ _test/go.md | 2 +- go/desktop/.htaccess | 2 +- go/developer/.htaccess | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.htaccess b/.htaccess index 4971530a..fc7ac490 100644 --- a/.htaccess +++ b/.htaccess @@ -234,6 +234,17 @@ RewriteRule "^(en)/keyboards/legacy/(.*)" "/_content/keyboards/keyboard.php?lega # /keyboards/countries to /keyboards/index.php RewriteRule "^(en)/keyboards/countries/(.*)" "/_content/keyboards/index.php?q=c:id:$2&lang=$1" [END] + +# +# contact/exception +# + +# /contact/exception to /contact/exception.php +RewriteRule "^(en)/contact/exception(.php)?" "/_content/contact/exception.php?lang=$1" [END,QSA] + +RewriteRule "^(en)/contact/exception?id=(.+)$" "/_content/contact/exception?id=$2&lang=$1" [END] + + # # downloads/releases # diff --git a/_test/go.md b/_test/go.md index ed64ed2a..05493431 100644 --- a/_test/go.md +++ b/_test/go.md @@ -64,7 +64,7 @@ showmenu: false ## android ### /go/android/X.Y/download-keyboards/languages -Royce, Scott, and Darcy attending Colloquium on Fonts for Southeast Asian scripts + [download-keyboards/languages](/go/android/16.0/download-keyboards/languages/km) [live: download-keyboards/languages](https://keyman.com/go/android/16.0/download-keyboards/languages/km) diff --git a/go/desktop/.htaccess b/go/desktop/.htaccess index 10f05eff..72c74466 100644 --- a/go/desktop/.htaccess +++ b/go/desktop/.htaccess @@ -31,7 +31,7 @@ RewriteRule "^([1-9][0-9]\.[0-9])/create-locale" "https://secure.tavultesoft.com # /go/desktop/X.Y/view-exception/ to /contact/exception" # This endpoint is not used in 14.0 or later -RewriteRule "^1[0123]\.0/view-exception(/)?$" "/contact/exception.php" [R=301,QSA] +RewriteRule "^1[0123]\.0/view-exception(/)?$" "/contact/exception" [R=301,QSA] # /go/desktop/X.Y/view-exception?id=" diff --git a/go/developer/.htaccess b/go/developer/.htaccess index 5bc28e88..6b140c8d 100644 --- a/go/developer/.htaccess +++ b/go/developer/.htaccess @@ -21,7 +21,7 @@ RewriteRule "^([1-9][0-9]\.[0-9])/language-lookup" "https://www.ethnologue.com/" # "/go/developer/X.Y/view-exception/ to /contact/exception" -RewriteRule "^([1-9][0-9]\.[0-9])/view-exception(/)?$" "/contact/exception.php" [R=301,QSA] +RewriteRule "^([1-9][0-9]\.[0-9])/view-exception(/)?$" "/contact/exception" [R=301,QSA] # "/go/developer/X.Y/view-exception?id=" From 53ba79aeaead098bba9d039dda7ab537c17e14d7 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Mon, 6 Apr 2026 10:48:09 +0700 Subject: [PATCH 18/38] fix menu link to "Help and Documentation" --- _includes/2020/templates/Menu.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_includes/2020/templates/Menu.php b/_includes/2020/templates/Menu.php index 28bfcc48..417be7e3 100644 --- a/_includes/2020/templates/Menu.php +++ b/_includes/2020/templates/Menu.php @@ -22,8 +22,8 @@ public static function render(array $fields): void { $fields->beta_version = KeymanVersion::beta_version; // Fallback to 'en' - // TODO-I18N-URL-SCHEME: integrate with Locale.php - $fields->lang = isset($_REQUEST['lang']) ? $_REQUEST['lang'] : 'en'; + // TODO-I18N-URL-SCHEME: integrate with Locale.php + $fields->lang = isset($_REQUEST['lang']) ? $_REQUEST['lang'] : 'en'; echo << @@ -300,7 +300,7 @@ private static function render_top_menu(object $fields): void {
  • Training Events
  • Free on all Platforms
  • LDML Support
  • -
  • Help and Documentation
  • +
  • Help and Documentation
  • Contact Us
  • Keyman Blog
  • Testimonials
  • From 35f00a4b80195491e1514a466b8fe87e65552532 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Mon, 6 Apr 2026 10:58:08 +0700 Subject: [PATCH 19/38] chore: cleanup more _test paths --- _test/index.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/_test/index.md b/_test/index.md index be6b99b7..06deaa37 100644 --- a/_test/index.md +++ b/_test/index.md @@ -23,15 +23,15 @@ showmenu: false ## Links to Other Test Pages -[/go links](./go) +[/go links](go) -[/keyboards links](./keyboards) +[/keyboards links](keyboards) -[keyboard language landing links](./language-landing) +[keyboard language landing links](language-landing) -[/_legacy keyboards links](./legacy) +[/_legacy keyboards links](legacy) -[/well-known links](./well-known) +[/well-known links](well-known) ## Link to Main Page From 38222712087b94789a6679db2301abea67c642cb Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Mon, 6 Apr 2026 11:37:48 +0700 Subject: [PATCH 20/38] revert $fields->lang in template links --- .htaccess | 2 +- _includes/2020/templates/Foot.php | 11 +--- _includes/2020/templates/Head.php | 4 -- _includes/2020/templates/Menu.php | 100 ++++++++++++++---------------- 4 files changed, 52 insertions(+), 65 deletions(-) diff --git a/.htaccess b/.htaccess index fc7ac490..2c778ba2 100644 --- a/.htaccess +++ b/.htaccess @@ -116,7 +116,7 @@ RewriteRule "^keyboard(/.*)$" "/keyboards$1" [R,END] RedirectMatch "^/1([0-5])(\.0)\/?" "/1$1/" # ios -RedirectMatch "^/(?!iphone-and-ipad)(ios|iphone|ipad)(\/.*)?" "/iphone-and-ipad$2" +RedirectMatch "^/(?!iphone-and-ipad)(ios|iphone|ipad)(/.*)?" "/iphone-and-ipad$2" # Connect With Art landing page RedirectMatch "/connectwithart(\/|$)" "https://sites.google.com/sil.org/connectwithart/home" diff --git a/_includes/2020/templates/Foot.php b/_includes/2020/templates/Foot.php index f9358f87..b14ac531 100644 --- a/_includes/2020/templates/Foot.php +++ b/_includes/2020/templates/Foot.php @@ -12,11 +12,6 @@ static function render(array $fields = []) { $fields = (object)$fields; $fields->stable_version = KeymanVersion::stable_version; $fields->beta_version = KeymanVersion::beta_version; - - // Fallback to 'en' - // TODO-I18N-URL-SCHEME: integrate with Locale.php - $fields->lang = isset($_REQUEST['lang']) ? $_REQUEST['lang'] : 'en'; - ?> @@ -47,7 +42,7 @@ static function render(array $fields = []) { @@ -65,8 +60,8 @@ static function render(array $fields = []) { diff --git a/_includes/2020/templates/Head.php b/_includes/2020/templates/Head.php index c01aa379..c9218cac 100644 --- a/_includes/2020/templates/Head.php +++ b/_includes/2020/templates/Head.php @@ -32,10 +32,6 @@ static function render($fields = []) { $fields->js = []; } - // Fallback to 'en' - // TODO-I18N-URL-SCHEME: integrate with Locale.php - $fields->lang = isset($_REQUEST['lang']) ? $_REQUEST['lang'] : 'en'; - ?> language)) { diff --git a/_includes/2020/templates/Menu.php b/_includes/2020/templates/Menu.php index 417be7e3..4a9a197b 100644 --- a/_includes/2020/templates/Menu.php +++ b/_includes/2020/templates/Menu.php @@ -21,10 +21,6 @@ public static function render(array $fields): void { $fields->stable_version = KeymanVersion::stable_version; $fields->beta_version = KeymanVersion::beta_version; - // Fallback to 'en' - // TODO-I18N-URL-SCHEME: integrate with Locale.php - $fields->lang = isset($_REQUEST['lang']) ? $_REQUEST['lang'] : 'en'; - echo << END; @@ -132,7 +128,7 @@ private static function render_phone_menu(object $fields): void {

    Keyboards

    -
    + " alt="search button" value="Search" onclick="if(document.getElementById('language-search2').value==''){return false;}">
    @@ -141,45 +137,45 @@ private static function render_phone_menu(object $fields): void {
    @@ -206,7 +202,7 @@ private static function render_top_menu(object $fields): void { Keyman is free and open source -
    +
    @@ -224,7 +220,7 @@ private static function render_top_menu(object $fields): void {
    " alt="Keyman logo" />
    - +
    @@ -243,7 +239,7 @@ private static function render_top_menu(object $fields): void {