documentation icon indicating copy to clipboard operation
documentation copied to clipboard

[BUG] CLI’s non-index pages do not redirect to “default” version

Open DerekNonGeneric opened this issue 2 years ago • 2 comments

What / Why

Non-index pages for the npm CLI docs do not currently redirect to the “default” version when omitting the version number (e.g., https://docs.npmjs.com/cli/commands/npx). Because of this, no permalink is available for docs pages to the most relevant version of particular commands (amongst other versioned resources). If this previously worked, those links are currently broken (see below).

When

  • Malfunctioning (?) for at least the past couple of months

Where

All versioned npm CLI documentation content on the website (npm/documentation repo) deeper than these indices:

  • https://docs.npmjs.com/cli/v8/commands
  • https://docs.npmjs.com/cli/v8/configuring-npm
  • https://docs.npmjs.com/cli/v8/using-npm

How

Current Behavior

Currently, users are only redirected to the npm CLI’s “default” version of docs pages for the “index” pages (e.g., https://docs.npmjs.com/cli/commands redirects to https://docs.npmjs.com/cli/v8/commands/).

Steps to Reproduce

  1. Attempt to visit the “default” version of any page deeper than an “index” page by omitting the version number entirely (e.g., https://docs.npmjs.com/cli/commands/npx)

  2. Expect to be redirected to the npm CLI’s “default” version of the docs page (e.g., https://docs.npmjs.com/cli/v8/commands/npx)

  3. See the 404 error page instead (https://docs.npmjs.com/cli/commands/npx)

    image

Expected Behavior

Be redirected to the npm CLI’s “default” version for docs page deeper than “index” pages when omitting the version number from the URL. Otherwise, we’d currently have to update links to, e.g., particular commands, every new major version of the npm CLI to avoid our links going stale.

Who

  • @darcyclarke
  • @ruyadorno
  • @MylesBorins

References

DerekNonGeneric avatar Jul 15 '22 22:07 DerekNonGeneric


title: Managing teams redirect_from:

  • /orgs/managing-teams

ITSKATYMABYBABY avatar Aug 04 '22 05:08 ITSKATYMABYBABY

@katelyn43

ITSKATYMABYBABY avatar Aug 04 '22 05:08 ITSKATYMABYBABY

Thanks for the thorough report! This was fixed by #242. Let me know if I missed any others that should be redirecting.

lukekarrys avatar Oct 18 '22 18:10 lukekarrys