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

Static caching caches domains with . at the end #11504

Open
indykoning opened this issue Feb 26, 2025 · 1 comment
Open

Static caching caches domains with . at the end #11504

indykoning opened this issue Feb 26, 2025 · 1 comment
Labels

Comments

@indykoning
Copy link
Contributor

indykoning commented Feb 26, 2025

Bug description

When going to https://example.com. you end up at the same domain and same site as https://example.com except that all Laravel Route and url functions include this . at the end of the domain.

Statamic caches this in _.html instead of e.g. ._.html (or rather not caching at all) causing anyone to visit https://example.com after this to have all links pointed to https://example.com.

This causes issues because other applications do consider this to be a completely separate domain. This breaks access-control-allow-origin for instance.

How to reproduce

Set up static caching on a domain (preferably served by nginx)

navigate tot his domain with a . added to the end.
Check if it has been cached.
Now navigate to the same domain without that .
Search your html for your domain with the . included at the end.

Logs

Environment

Environment
Application Name: XXXX
Laravel Version: 11.43.2
PHP Version: 8.2.25
Composer Version: 2.8.1
Environment: production
Debug Mode: OFF
URL: example.com
Maintenance Mode: OFF
Timezone: Europe/Amsterdam
Locale: nl

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: redis
Database: mysql
Logs: daily
Mail: smtp
Queue: sync
Session: file

Sentry
Enabled: YES
Environment: production
Laravel SDK Version: 4.12.0
PHP SDK Version: 4.10.0
Release: NOT SET
Sample Rate Errors: 100%
Sample Rate Performance Monitoring: NOT SET
Sample Rate Profiling: NOT SET
Send Default PII: DISABLED

Statamic
Addons: 4
Sites: 1
Stache Watcher: Enabled
Static Caching: full
Version: 5.47.0 PRO

Statamic Addons
justbetter/statamic-glide-directive: 2.6.1
statamic-rad-pack/runway: 7.13.5
statamic/eloquent-driver: 4.19.1

Statamic Eloquent Driver
Asset Containers: file
Assets: file
Blueprints: eloquent
Collection Trees: file
Collections: file
Entries: eloquent
Forms: eloquent
Global Sets: eloquent
Global Variables: eloquent
Navigation Trees: eloquent
Navigations: file
Revisions: eloquent
Sites: file
Taxonomies: file
Terms: eloquent
Tokens: file

Installation

Fresh statamic/statamic site via CLI

Additional details

A temporary solution can be found here: https://stackoverflow.com/questions/15452328/nginx-redirect-domain-trailing-dot

@duncanmcclean
Copy link
Member

Are you able to provide the full output of php please support:details?

@duncanmcclean duncanmcclean changed the title Static caching caches domains with at the end . Static caching caches domains with . at the end Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants