Hello, how can I create pages with urls that alway...
# kobweb
a
Hello, how can I create pages with urls that always finish with a trailing slash ? An example with
@Page("/about/")
: •
/about/
Doesn't redirect to anything •
/about
Redirects to
/about/
The current behaviour is the inverse, going to the page with a trailing page redirects you to the same page without the trailing slash.
s
why do you even want urls with trailing slashes?
also creating a folder/index.html is really not how you should do things
^ for every single page other than the actual index
a
I find this more clean, and some says that it's better for SEO (but it's a really unclear subject, I want to try to move onto this and see the stats)
s
I really doubt one has an edge over the other. but you definitely want to only support one of those. google might thing /about and /about/ are two different urls, which is definitely bad for seo
a
Yes I know that, that's why I want to stick with a specific one, and I prefer with trailing slash as it seems cleaner to my eyes
s
how are you hosting the site? if you're hosting the static files that might be something better done with nginx/apache than kobweb
a
It's on Cloudflare Page
s
isn't this for static sites?
a
My site is a static one 🙂
s
a
I don't want redirects, also Kobweb already redirects to "without trailing slash" by default with
@Page("/about")
and going into
/about/
, it would make an infinite loop if I also redirect from Cloudflare into "with trailing slash"
s
no, you would do it the other way, however options here are limited. I thought /about/ does not work?
a
By default kobweb will allow to go on this page (it will not be considered as 404), but you will be redirected to the page without trailing slash
But I found on the documentation that if you specify
@Page("/about/index")
I get the behaviour I'm looking for !
👍🏻 1
s
By default kobweb will allow to go on this page (it will not be considered as 404), but you will be redirected to the page without trailing slash
yeah that would be the stuff I'd try to configure my hosting for
@Page("/about/index")
should add the folder for you yea