-
-
Notifications
You must be signed in to change notification settings - Fork 617
URL::enforceTrailingSlashes causes 404 on home page of site with url prefix #14024
Copy link
Copy link
Closed
Closed
Copy link
Description
Bug description
Tried setting up a home page on a multisite-enabled project (in trial mode on my local machine), but got 404 constantly. Eventually found out that multi-site is not needed to reproduce, but the site url needs a path prefix like /en/ or similar.
How to reproduce
Minimal example, multi-site is not needed.
Start a new site with statamic new, then go to site settings and changing the site url to e.g. /en/. Copying sites.yaml below:
default:
name: '{{ config:app:name }}'
url: /en/
locale: '{{ config:app:locale }}'home page at /en/ still works.
Then add to boot method in AppServiceProvider:
public function boot(): void
{
URL::enforceTrailingSlashes();
}
and it stops working.
Logs
Environment
Environment
Application Name: Statamic
Laravel Version: 12.52.0
PHP Version: 8.4.16
Composer Version: 2.8.8
Environment: local
Debug Mode: ENABLED
URL: trailing-slashes-bug.test
Maintenance Mode: OFF
Timezone: UTC
Locale: en
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED
Drivers
Broadcasting: log
Cache: file
Database: sqlite
Logs: stack / single
Mail: log
Queue: sync
Session: file
Storage
public/storage: NOT LINKED
Statamic
Addons: 1
Sites: 1
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 6.3.2 Solo
Statamic Addons
statamic/ssg: 4.0.0Installation
Fresh statamic/statamic site via CLI
Additional details
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels