Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

How to remove trailing slash from generated URLs


Go to End


2 Posts   2079 Views

Avatar
TotalNet

Community Member, 181 Posts

6 July 2009 at 2:48pm

Edited: 06/07/2009 2:49pm

There is probably a good reason that the CMS adds a trailing slash "/" to all links generated by it, however, I would like to remove this because it interferes with relative URLs and while I know this can be partially solved with the base tag it doesn't help when I want to append a query string or anchor to the current URL.

Is there a directive that can be put in _config.php to override this behaviour?

Cheers

Rich

Avatar
Garrett

Community Member, 245 Posts

22 October 2009 at 9:32am

HEAR HEAR! I am having a huge issue with this, actually, using the StaticPublisher. All the links in my static html files have trailing slashes and (as a result of something configured in .htaccess) it causes none of the links to work! The links ONLY work withOUT the trailing slash, and generate 404's WITH. Any ideas??

This is an urgent problem. ANY and ALL help would be greatly appreciated. How can I remove them?

//Garrett