How to prevent redirect loop
Hi , i creatd API redirect rule . basically if the url does not end with slash , then I want to redirect the same url with slash at the end . The logic to judge whether slash is at the end is working fine . but when i implement this logic , the redirect loop happens in preview page . anyone knows why is this happening ? Hi there , just wondering if there is any update on this ? Page is accessble whether there is slash at the end or not and it seems that it is confusing google bot because they are indexing both pages even though I have set up canonical already . You guys published new features so wondering if there is any solution now Alright . I have some positive and some negative news for you 😉 The positive : - It 's technically possible with our new redirect solution (still feature flagged at https://app.nordcraft.com/flags ) - You might need to set up multiple redirects , and potentially detect whether a url is missing a trailing slash with a regex . Here 's a simple implementation https://editor.nordcraft.com/projects/trailing_slash/branches/start/routes/Trailing%20slash?canvas-width=800&canvas-height=800&selection=routes.Trailing%2520slash.destination&rightpanel=style - You can see the redirect behavior here https://start-trailing_slash.toddle.site/yoyo (which should redirect with a 302 to https://start-trailing_slash.toddle.site/yoyo/ ) The negative : - While we do want to support a better way of configuring trailing slash behavior on a project , that is not the most urgent issue on our roadmap atm - Using the redirect behavior above , you might need to set up multiple redirects - and specifically the index page (on / ) behaves a bit strange when you try to parse it (see screenshot ) We plan to release redirects this week . The docs has not been updated yet , but we do have a PR ready for it here https://github.com/nordcraftengine/documentation/pull/295 https://cdn.discordapp.com/attachments/1070246768983408710/1384139451453931543/CleanShot_2025-06-16_at_13.55.19.png?ex=685157d1&is=68500651&hm=87e8da0e8aad0e40bf5b800891cd9bd344799e9e429b4dfb9f3ddbe9fd17e466&