Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UVE: Fix Trailing Slash Issue in dotCMS #30984

Closed
1 task
fmontes opened this issue Dec 19, 2024 · 4 comments · Fixed by #31093
Closed
1 task

UVE: Fix Trailing Slash Issue in dotCMS #30984

fmontes opened this issue Dec 19, 2024 · 4 comments · Fixed by #31093
Assignees
Labels
LTS: Excluded Ticket that has been excluded from at least one LTS LTS: Next Patch Shortlisted of issues that will be included in the upcoming LTS patch OKR : Core Features Owned by Will Priority : 3 Average QA : Passed Internal Release : 25.01.13 Team : Bug Fixers Type : Defect

Comments

@fmontes
Copy link
Member

fmontes commented Dec 19, 2024

Problem Statement

When editing a page with "index" in the URL, the trailing slash is being removed, resulting in a different URL format than the standard. This causes potential inconsistencies in the page URLs.

Steps to Reproduce

  1. Create a page with "index" in the URL, such as "about-us/index".
  2. Edit the page URL
  3. Check the network request to the page api and and observe that the trailing slash is removed, resulting in "about-us" instead of "about-us/".
trailing-slash.mp4

Acceptance Criteria

  • Add trailing / when remove the index

External Links

#30960

Assumptions & Initiation Needs

  • The fix should ensure that URLs with "index" retain the trailing slash to maintain consistency.
  • The development team will need to review and implement the fix in the dotCMS system.

Quality Assurance Notes & Workarounds

N/A

@fmontes
Copy link
Member Author

fmontes commented Dec 19, 2024

RFC 3986, which defines the syntax for URIs (Uniform Resource Identifiers), provides some guidance on how URIs may be compared and how path segments are interpreted. However, it does not specify detailed rules concerning the specific handling of URLs with “trailing slashes” (/about/) versus those without (/about). This distinction is usually dependent on the server and how it is configured to handle paths.

Broadly speaking, a “trailing slash” implies that the URI refers to a directory or a high-level view of a set of resources, while the absence of a slash suggests that the URI points to a specific resource, which could be a document or a page. Here are some practical implications regarding design and server operation:

  1. Normalization: Section 6 of RFC 3986 discusses how to normalize URIs for comparison and resolution purposes. Adding or removing a “trailing slash” can change the interpretation of the URI. For example, the URIs ⁠/about and ⁠/about/ are considered different and can respond differently.

  2. Relative Reference Resolution: According to the same RFC, the presence of a “trailing slash” affects how relative references are resolved. For instance, if the base URI is ⁠/about/ and the relative link is ⁠team, the resulting URI would be ⁠/about/team. If the base were ⁠/about (without the slash), the same relative link would result in ⁠/team, which generally points to a completely different resource.

3.Server Interpretation: How these URIs are handled depends on the server. Some servers will automatically redirect a URI that points to a directory but lacks a “trailing slash” to add it (for example, redirecting from ⁠/about to ⁠/about/), as this can be important for how relative paths are handled on the client side.

In summary, RFC 3986 addresses how URIs should be interpreted and normalized, but it is the practices of servers and applications that determine how URIs ending in a “trailing slash” are specifically managed. It is common in web design to use a “trailing slash” to denote directories and its omission to indicate specific files or services, but the practical handling of this can vary.

Copy link

github-actions bot commented Jan 9, 2025

@github-project-automation github-project-automation bot moved this from In Progress to Done in dotCMS - Product Planning Jan 10, 2025
@erickgonzalez erickgonzalez moved this from Done to Internal QA in dotCMS - Product Planning Jan 10, 2025
@github-project-automation github-project-automation bot moved this from Internal QA to Current Sprint Backlog in dotCMS - Product Planning Jan 13, 2025
@KevinDavilaDotCMS KevinDavilaDotCMS moved this from Current Sprint Backlog to Internal QA in dotCMS - Product Planning Jan 13, 2025
@erickgonzalez erickgonzalez added LTS: Needs Backport Ticket that will be added to LTS LTS: Next Patch Shortlisted of issues that will be included in the upcoming LTS patch labels Jan 13, 2025
@dsolistorres
Copy link
Contributor

Internal QA Approved:

  • Now, when opening 'about-us/index' page from the dotCMS UVE, the page request is send to 'about-us/', without removing the trailing slash, that returns the 'about-us/index' page as expected.
  • Also, when opening a page from the dotCMS UVE, if there is a Vanity URL pointing to the same URL than the page, the Vanity URL takes precedence so the target page for the Vanity URL is opened in the UVE.

@erickgonzalez erickgonzalez added LTS: Excluded Ticket that has been excluded from at least one LTS and removed LTS: Needs Backport Ticket that will be added to LTS labels Jan 16, 2025
@erickgonzalez
Copy link
Contributor

Only for 24.12 LTS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTS: Excluded Ticket that has been excluded from at least one LTS LTS: Next Patch Shortlisted of issues that will be included in the upcoming LTS patch OKR : Core Features Owned by Will Priority : 3 Average QA : Passed Internal Release : 25.01.13 Team : Bug Fixers Type : Defect
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants