trailing slash for some routes to support legacy URLs?

29 views
Skip to first unread message

JT

unread,
Dec 5, 2017, 6:54:38 PM12/5/17
to Fat-Free Framework
Is there a way to add a trailing slash to some routes and not others?

has trailing slash = demo.com/en/
has trailing slash = demo.com/en/episodes/
has no trailing slash = demo.com/en/episodes/92011

I can't figure out how to get this to work with F3
I can do it with other frameworks but am looking for one with no dependencies so thought F3 would do the trick

bcosca

unread,
Dec 5, 2017, 7:11:15 PM12/5/17
to f3-fra...@googlegroups.com
Why make the distinction in the first place? If it's not a conventional directory, F3 automatically redirects to the route without the trailing slash for consistency.

https://webmasters.googleblog.com/2010/04/to-slash-or-not-to-slash.html

JT

unread,
Dec 5, 2017, 7:26:26 PM12/5/17
to f3-fra...@googlegroups.com
Unfortunately for me legacy urls must be supported, we are upgrading from a multilingual cms that always added a trailing slash.
There are no actual folders/directories related to the url paths.

I suppose I could implement a 302 redirect in the htaccess but was hoping to do it in f3 only since there are so many

I don't mind if we loose the legacy urls as long as there's a 302 for google and it redirects to the unslashed url in f3

bcosca

unread,
Dec 5, 2017, 7:30:27 PM12/5/17
to Fat-Free Framework
It shouldn't make any difference then if demo.com/en/ gets redirected to demo.com/en because the same page gets served. This is also good for SEO because there are no duplicate content.

JT

unread,
Dec 5, 2017, 7:59:24 PM12/5/17
to Fat-Free Framework
you're right, I was over thinking the issue

thanks mate
Reply all
Reply to author
Forward
0 new messages