Skip to content

Support SPDX IDs with Dots in License URL Paths #219

Closed

Description

@anastas10s-afk

Summary:
License URLs to use SPDX identifiers, which contain dots (e.g., /license/apache-2.0), rather than WordPress’s default approach of replacing dots with dashes (/license/apache-2-0).

Background:
WordPress by default strips dots from URL slugs to avoid conflicts, as dots typically indicate file extensions. Overriding this is technically possible (e.g., with Permalink Manager or a custom function), but it comes with caveats.

Risks/Considerations:

  • Dots in URLs may be interpreted by web servers, CDNs (e.g., Cloudflare), or caching layers as file extensions, potentially causing issues with content serving, caching, SEO, or site reliability.
  • Future WP updates may change how slugs are sanitized, introducing possible breakage.
  • Override would be non-standard (against WP default behavior).

Request / Next Steps:

  • The technical risk is understood, but SPDX IDs with dots for canonical URLs would be preferred if possible.
  • Plan: We can do some tests in staging first using a custom lightweight sanitize_title function to allow slugs to retain dots.

Activity

  1. nickvidal commented on Mar 10, 2026

    @nickvidal
    Member

    @anastas10s-afk : I believe I might have fixed the dotted SPDXs for all licenses. Any dashed SPDXs will be redirected to the dotted ones as well. For example, now https://opensource.org/license/Apache-2-0 redirects to https://opensource.org/license/apache-2.0

    Even though the page slug converts dots to dashes automatically, the redirection plugin seems to work. Would you be able to confirm if that's the case please and if this trigger any issues you listed above?

  2. mjaragon commented on Mar 25, 2026

    @mjaragon
    Collaborator

    Hey @nickvidal ,

    Thank you for sharing this alternative solution.

    We've done quite a bit of internal research and concluded that if the redirections work for you, we think your solution is quite good, and we can’t see any downsides so far.

    • Since it's a redirection, the slug of the posts keeps the dash ("-"), and hence most of the risks we mentioned above won't apply, as external queries can continue using the dash (e.g., CLI, REST, etc.).
    • Because of the redirect, crawlers should pick up the new URL for SEO.
    • There will exist mismatch info (example, on RSS feed the dash ("-") version will appear, but then the crawler should get a dot (".") because of the redirect. But it still works.

    So all in all, if it works for you, we think your redirects are a good option 👍

  3. nickvidal commented on Mar 27, 2026

    @nickvidal
    Member

    Thank you @mjaragon

    Also referencing a PR created by @mlaetitia: #220

  4. mjaragon commented on Mar 27, 2026

    @mjaragon
    Collaborator

    Thank you @nickvidal ,

    Also referencing a PR created by @mlaetitia: #220

    If the redirects are working for you, we don't need to move forward with the PR we were working on. 👍

    From our email conversation:

    we initially started working on this to enable dots on the page slugs. That was before the comment above mentioned that the redirects could also be a viable solution for what you were looking for.

    Since the redirects are working well for you, we'd recommend not adopting the changes in the PR we had started (it still needed additional testing), and keeping the dashes in the slugs. This would avoid introducing additional customization if it's not needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions