AI OnAI Off
Try setting RoutingOptions.UseTrailingSlash to false. Either in Startup.cs or in your appsettings.json file.
This would be the purest solution, as it avoids adding it in the first place.
What was the websockets issues you were facing ?
you have done in a similar manner described here https://world.optimizely.com/blogs/Minesh-Shah/Dates/2023/2/url-rewrites-in-cms12--net-6-/
and I did not face any issues using
options.AddRedirect("(.*)/$", "$1");
Is there a way to remove trailing slashes on front end pages only in Optimizely 12? This seems to cause an issue with the CMS when I add it to startup.cs
var options = new RewriteOptions()
.AddRedirect("(.*)/$", "$1", 301 /* Moved Permanently */);
app.UseRewriter(options);
It was causing a websockets issue so I turned it off for now.