Using hyphens to separate URLs instead of underscores

Created on 31 March 2023, almost 2 years ago
Updated 28 April 2023, over 1 year ago

Problem/Motivation

It is recommended to use hyphens to separate URLs instead of underscores
https://developers.google.com/search/docs/crawling-indexing/url-structur...,(%20_%20)%20in%20your%20URLs.

Some examples:

  • /admin/reports/views-plugins
  • /admin/reports/access-denied
  • /admin/config/development/configuration/config-split

User interface changes

Replace "_" with "-" on module URLs

📌 Task
Status

Fixed

Version

1.1

Component

Code

Created by

🇪🇸Spain GeduR

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @GeduR
  • 🇪🇸Spain tunic Madrid

    I'm wondering if we should keep the old URLs for a while.The module has not so many users so I guess we can skip this part, because is not trivial.

    We could use a redirection, but that's implies using the Redirect module (no way) or adding custom code (it feels like an overkill). We could also duplicate menu items with each url and adding a deprecation warning, but it also seems too much effort.

    I guess it is enough to comment it in release notes or maybe creating a change record. I would go with the change record just to get more used to them, I have barely used them.

  • Assigned to tunic
  • 🇪🇸Spain lpeidro Madrid

    @tunic I assign you the issue.

    Thanks.

  • Status changed to Fixed almost 2 years ago
  • 🇪🇸Spain tunic Madrid

    Committed changes to 1.1.x .branch.

  • Status changed to Needs work almost 2 years ago
  • 🇪🇸Spain tunic Madrid

    Oops, I missed some URLs, I only changed the group plugins URLs.

  • Status changed to Needs review almost 2 years ago
  • 🇪🇸Spain tunic Madrid

    Well, is not that simple.

    The plugin id is used as-is in the URL. Currently, the plugin ids are like this:

    • queries_data_vocabulary
    • queries_data
    • queries_data_user
    • ux_ui_architecture
    • ...

    We only need to change the plugin ids... but machine names tend to use underscores. We could add code to handle this (transform the id string to use hyphens when it is used for the URL) but I don't think it's worth the effort. Also, the URLs are internal, not to be published, son the biggest problem is they may feel awkward.

    I've changed the easy routes (the ones that are in the module's routing file).

  • Assigned to lpeidro
  • 🇪🇸Spain lpeidro Madrid

    Thanks @tunic not problem, I check your commit and try to solve this issue, I think that I know the easiest way to do it.

  • Issue was unassigned.
  • Status changed to Fixed almost 2 years ago
  • 🇪🇸Spain lpeidro Madrid

    I have checked it and you are right, it is not worth the effort.

  • Status changed to Fixed over 1 year ago
Production build 0.71.5 2024