I am currently experiencing an issue with automatic permanent redirects on routes that do not have a trailing slash.
Specifically, when accessing URLs like
https://example.com/blog, Cloudflare automatically redirects to
https://example.com/blog/ (the trailing slash is added)
I want to disable this behaviour. Does anyone have a possible solution for this?
P.S I see many similar issues, but don’t see a clear solution
My site is created using Astro
This sounds like a Pages Project.
That’s because there isn’t. What problem is this causing?
So Astro can handle trailing slash on URL by itself.
example.com/blog/ will respond with same page (it’s the default setting and also my preferred setting)
On my website, I have set all all my cannonical URL’s to be one without the trailing slash for the same reason, so that makes the redirect from cloudflare really unnecessary and just add an extra step when resolving the page.
I want to get rid of that, so my cannonical are correct to how I want my pages to resolve (without the trailing slash)
Is there any reason why this is default setting in cloudflare and can’t be altered?