craftcms / docs

Documentation for Craft CMS, Craft Commerce, and other official products.
https://craftcms.com/docs
39 stars 150 forks source link

[Bug]: Wrong redirect to version 2 for links without version #539

Open frank-laemmer opened 1 year ago

frank-laemmer commented 1 year ago

Page URL

https://craftcms.com/docs/updating.html

Client

FireFox, Chrome, doesn't matter

Description

Details

I'd like to link to link a Craft CMS install guide without specifying the version.

Here is an example from Laravel: https://laravel.com/docs/deployment will redirect to https://laravel.com/docs/10.x/deployment.

It seem you have folks have implemented such behavior (.htaccess?), but it redirect to version 2.x of Craft CMS at least for some pages I tested:

Steps to reproduce the issue

  1. Open https://craftcms.com/docs/updating.html
  2. See it will redirect to https://craftcms.com/docs/2.x/updating.html
  3. Expected: https://craftcms.com/docs/4.x/updating.html

Same for:

https://craftcms.com/docs/requirements.html https://craftcms.com/docs/folder-structure.html

AugustMiller commented 1 year ago

These redirects are likely in place due to legacy documentation structures—you can see a complete list of redirections that our provider (Netlify) will perform, in the _redirects file.

I will make sure to update some of these “versionless” pages to point at the equivalent 4.x pages!

Edit: I don't know if within the current system it makes sense to create bulk redirects from the non-versioned URLs (i.e. /docs/elements.html), but know that we are looking into streamlining the structure + routing of the documentation, as a whole!

frank-laemmer commented 1 year ago

Missed that file. Sorry for the somehow lazy ticket here. I hope you can work it out. I found:

/docs/updating* https://craftcms.com/docs/2.x/updating.html
/docs/requirements* https://craftcms.com/docs/2.x/requirements.html

But there are some more also to version 3. It just seems that this hasn't been updated for a while. I don't know about the inner workings and where the original links come from so I will not file a PR. Thanks for taking care.