flora-pm / flora-server

A package index for the Haskell ecosystem
https://flora.pm/about
Other
125 stars 38 forks source link

URL uniformisation for namespaces prefix (/@ vs /&40) #601

Open TixieSalander opened 1 week ago

TixieSalander commented 1 week ago

Environment

Expected Behaviour

All URLs containing a namespace will display the @ character correctly

Actual Behaviour

While a package main pages and handling it correctly (for example https://flora.pm/packages/@hackage/diagrams-pgf and https://flora.pm/packages/@hackage), all the links from those pages to other sub-pages or other related pages have URLs where @ is replaced by %40:

It would be best to have one single behavior (even if both URLs manually entered either with @ or %40 displays the expected pages).

With that last point comes an additional issues: several URLs are displaying the same content. Duplicated content is not a desired behavior since it gonna have a negative impact on search engines and other tools who try to make sense of the website's structure.

To avoid duplicate content either, we can add:

  1. A redirection (for every /%40foobar URLs to be redirected to /@foobar
  2. A canonical link tag in the of both version pointing to the preferred version (as declared my preference come to the version with @.