routify icon indicating copy to clipboard operation
routify copied to clipboard

Add Routify config option to preserve/strip/force the trailing slash on urls

Open jdkdev opened this issue 6 months ago • 0 comments

Describe the feature

We are starting to get some bigger clients that are tracking url and clicks in Google anayltics like hawks. And sometimes it's the direct link they see /my-page/ but then if the user clicks around the SPA and take action it could fire with /my-page as the event url....causing split metrics ..

and spank creates the /my-page/index.html so Cloudflare serves that up as /my-page/ as the 200 and /my-page as the 308 redirect.

Suggestion: maybe trailing slashes should have three options then: force, strip, preserve

Reference: https://github.com/roxiness/routify/blob/next/lib/runtime/Router/Router.js#L329

Examples

/my-page/ loads and then url updates to /my-page, with this option it would stay /my-page/

jdkdev avatar Jan 18 '24 19:01 jdkdev