-
Notifications
You must be signed in to change notification settings - Fork 1
Trailing slashes #1293
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
Comments
Statamic doesn't currently support trailing slashes in URLs, but it is on our roadmap: It doesn't look like we currently have a feature request issue open for it, so I'm going to transfer this to the |
Any news? I am about to relaunch a WordPress site on Statamic and wonder if it would be possible to easily enforce trailing slashes. To add context: I would use Full Measure Static Caching. More precisely:
|
Sorry, I don't have any news on this, or an ETA. We'll update this issue when we have any news. |
Is there a workaround for this until it will be launched? Or any news? |
The workaround is to add a server rewrite rule to redirect the trailing slash url to the non-trailing slash url. Something like this: rewrite ^/(.*)/$ /$1 permanent; |
Thanks Jason! We are migrating a site that depends heavily on organic search traffic within the next few months - and our SEO consultants advise against redirecting all URL's without a very good reason. I'd be hoping to find a "quick and dirty" solution that fixes {{url}} tags as well as sitemap/hreflang/canonical etc generation, allowing us to actually be using an ending / until statamic team pushes the feature #9997 from roadmap. |
If you're providing 301 redirects I don't think there's a hit to SEO. But I'm no expert. |
Uh oh!
There was an error while loading. Please reload this page.
Bug description
Are trailing slashes supported? I can't find a definitive answer to this in any of the existing issues or on Discord.
I have added trailing slashes to each of my collections but calling
$entry->url
always returns a url without a trailing slash.Personally I can do without trailing slashes but some of my clients insist on maintaining the slash structure when switching from WordPress to Statamic.
If they are supported by Statamic then I think there is a bug.
How to reproduce
Create a collection with a trailing slash route, e.g.:
{parent_uri}/{slug}/
Call {{ $entry->url }} and noticed that trailing slashes are not visible.
Logs
No response
Environment
Installation
Fresh statamic/statamic site via CLI
Additional details
No response
The text was updated successfully, but these errors were encountered: