question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trailing `/` in i18n Redirects to `/learn`

See original GitHub issue

Noticed in: https://github.com/freeCodeCamp/freeCodeCamp/pull/44809

To Reproduce

  1. Go to: https://www.freecodecamp.org/portuguese/learn/
  2. See 301 redirect to /learn

OR

  1. Go to https://www.freecodecamp.org/learn/
  2. Choose another language
  3. Refresh the page
  4. See 301 to /learn

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
raisedadeadcommented, Feb 28, 2022

This is blocked by upcoming containerization

0reactions
sidemtcommented, Oct 25, 2022

Some additional information and thoughts.


Here is a bug report from a camper: https://twitter.com/WIPjVrUKr0cNazQ/status/1584593154451595265?s=20&t=I5py5Jbf-6JnaILWZZEkWg

They bookmarked the Japanese top page of /learn (that has the URL https://www.freecodecamp.org/japanese/learn/ by default) but every time they open it it redirects to the English page.

I’ve also seen many Japanese tweets that say the URL of the Japanese page they shared doesn’t work.

Details of the reported issue

Steps to reproduce:

  1. Go to https://www.freecodecamp.org/learn/
  2. Change the language to Japanese (日本語) from the Menu
  3. Bookmark that page
  4. Open the bookmark

Actual result: User is redirected to the English page Expected result: User can open the Japanese page


As a workaround for the situation above, they can edit the bookmarked URL and remove the trailing /.

So I thought, if we could prevent the trailing / appearing in the URL in the address bar of the browser, we could reduce the chances that users encounter this issue. If it’s easier than fixing the redirect.

However, after some discussion with Shaun in the dev team chat, the traling / seems to be added by the browser. So it may not be an easy fix either.

The conversation we had

image Clipboard - October 24, 2022 10_27 PM The link about trailing slash in the conversation above: https://developers.google.com/search/blog/2010/04/to-slash-or-not-to-slash

I think this issue is heavily affecting the experience of international users. I’ll continue looking for if there is something we can do to improve the situation, but I’m not familiar with all the frameworks behind the issue so I appreciate your feedback and help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Advanced Features: Internationalized Routing - Next.js
Next.js has built-in support for internationalized (i18n) routing since v10.0.0 . You can provide a list of locales, the default locale, and domain-specific ......
Read more >
angular i18n: avoid trailing slash in url on prerendered root page
I prerender an i18n angular application and i've taught apache to work withouth trailing slashes when a directory is requested.
Read more >
Problem with trailing slash and global redirect - Drupal Answers
When the two modules enabled, the redirection in the home page not working. Does someone has solution for this? i18n-l10n.
Read more >
Global Redirect | Drupal.org
Checks the current URL for a trailing slash, removes it if present and ... been known issues with i18n causing redirect-loops and such....
Read more >
.htaccess redirect root to i18n content - Server Fault
"to https://example.com/en " - I assume the target URL should have a trailing slash? Is /en a physical directory? – MrWhite. Feb 3,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found