Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Modify stable url for keyboard download to kmp file #475

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

darcywong00
Copy link
Contributor

Fixes #474

From the reported issue,

Our sldr files use this form of url to reference a keyboard, but it just goes to the home page for the keyboard:
https://keyman.com/go/keyboard/sil_euro_latin/download/kmp

This one works: https://keyman.com/go/package/download/sil_euro_latin

We want to change /go/keyboard/**/download/kmp to match the behavior of /go/package instead of going to a keyboard landing page.

This modifies the rule in .htaccess to match what /go/package does.

keyman.com/go/.htaccess

Lines 27 to 28 in b695ba0

# download-package
RewriteRule "^package/download/(keyboard/)?([^/]+)$" "package/download.php?type=keyboard&id=$2" [END,QSA]

The links can be manually compared on

keyman.com/_test/go.md

Lines 348 to 354 in b695ba0

## keyboard permalinks
### download-kmp
[keyboard/khmer_angkor/download/kmp](/go/keyboard/khmer_angkor/download/kmp)
[live: keyboard/khmer_angkor/download/kmp](https://keyman.com/go/keyboard/khmer_angkor/download/kmp)

Until this PR is merged, localhost will redirect to the kmp file while the live site still goes to the keyboard page.

@darcywong00 darcywong00 added this to the A18S11 milestone Sep 25, 2024
Copy link
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, is this a much older bug, not actually coming out of the Apache/docker transition? Let's make sure we get it right for all patterns. The bundled installer .exe is now actually not a "bundle" but a file name pattern which causes the bundle to download (see https://kmn.sh/kb35, keyman-setup filename patterns section), so we may need to do some more work to get that right.

@@ -8,7 +8,8 @@ RedirectMatch "/go/(([1-9][0-9])([.]?)([0-9]))/developer-help-(mobile|packages)(
# Download redirects for keyboard permalinks (TODO: these three rules need refresh)

# download-kmp
RedirectMatch "/go/keyboard/([^/?]+)/download/kmp$" "/keyboards/download?id=$1&platform=windows&mode=standalone"
# Modified to match download-package below
RewriteRule "^keyboard/([^/]+)/download/kmp$" "package/download.php?type=keyboard&id=$1" [END,QSA]

#download-exe
RedirectMatch "/go/keyboard/([^/?]+)/download/exe$" "/keyboards/download?id=$1&platform=windows&mode=bundle"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about this rule and download-js? They also seem to be wrong?

@darcywong00 darcywong00 modified the milestones: A18S11, A18S12 Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Stable url for keyboard download no longer works
2 participants