SaaS CMS has officially launched! Learn more now.

Remove trailing slashes in Optimizely 12


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 */);

It was causing a websockets issue so I turned it off for now.

Mar 16, 2023 18:22

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.

Mar 16, 2023 19:42

What was the websockets issues you were facing ? 

you have done in a similar manner described here 

and I did not face any issues using

options.AddRedirect("(.*)/$", "$1");

Edited, Mar 17, 2023 0:39
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.