Skip to content

[6.x] Removes trailing slash when building relative Site URLs#14029

Merged
jasonvarga merged 1 commit intostatamic:6.xfrom
JohnathonKoster:bugfix/enforce-trailing-slashes-causes-404
Feb 23, 2026
Merged

[6.x] Removes trailing slash when building relative Site URLs#14029
jasonvarga merged 1 commit intostatamic:6.xfrom
JohnathonKoster:bugfix/enforce-trailing-slashes-causes-404

Conversation

@JohnathonKoster
Copy link
Copy Markdown
Contributor

This PR fixes #14024

The Problem

The incoming URL we ultimately compare against already has its trailing slash removed (https://github.com/laravel/framework/blob/12.x/src/Illuminate/Http/Request.php#L132).

The Site's relativePath method was leaving trailing slashes in-tact, which would make it so we never found the right thing.

The Fix

Remove the trailing slashes so comparisons are nice and happy.

@jasonvarga jasonvarga merged commit 8fcb524 into statamic:6.x Feb 23, 2026
12 checks passed
@Balletie
Copy link
Copy Markdown

Thanks @JohnathonKoster for finding this fix

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

URL::enforceTrailingSlashes causes 404 on home page of site with url prefix

3 participants