-
Notifications
You must be signed in to change notification settings - Fork 333
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
remove trailing slash from SiteTree links if no action present #2631
remove trailing slash from SiteTree links if no action present #2631
Conversation
Hi @xini, there’s been a lot of discussion about this in silverstripe/silverstripe-framework#8882, the general consensus was against making any changes to this in core (or at the very least, making any changes configurable/opt-in). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test failures would need addressing, and this change would need to be “opt-in”
Hi @kinglozzer, Thanks for your feedback. I completely agree with @dhensby 's last comment in silverstripe/silverstripe-framework#8882. In accordance with 3) this PR aligns As pointed out in that comment, redirects and canonical tags are left to a site's dev, rather than being considered the framework's responsibility. What is the best way to make this “opt-in”? Best would be for this to be the default for new installations, but optional for existing ones? How do I do that? Also, to make URLs more consistent (and the method simpler), `Controller::join_links()' could get an optional update as well. How would I link these PRs together over the two repos?
Thank you very much. |
Yep that’s good - adjusting link generation is far safer than adding redirects!
We achieved this with other issues by using config values which could then be added to the config in the recipe. One possible problem here is that we’re fixing the “remove trailing slashes” use case, but not the “force trailing slashes” one - both are equally valid. I’m going to post some ramblings on the linked issue, bear with me... |
I'm going to close this issue:
|
To my knowledge,
SiteTree::RelativeLink()
is currently the only place in SS where a trailing slash is added when there is no$action
parameter given.Controller::join_links
already adds slashes between sections of the path, this explicit slash is not needed.This change would help with canonicalisation of URLs.