Try our conversational search powered by Generative AI!

EPi 10 ContentRoute Obsolete

Vote:
 

Hi.

We are using ContentRoute on IInitializableModule to remove trailingslash for our site.  

ContentRoute.UseTrailingSlash = false;

After the update to EPiServer 10 this setting is obsolete.

I'm told that "Setting should be set on RoutingOptions instance retrevied from IOC" and i have done some test with this but can't make it work.

Do anyone have a POC or any idea how to make it work?

What i want to achive: www.xxx.se/news/ should be www.xxx.se/news

Best Regards

#171836
Nov 18, 2016 12:38
Vote:
 

Solved it - sharing the code below if anyone else has the same problem.

var routingOptions = ServiceLocator.Current.GetInstance<RoutingOptions>();
                routingOptions.UseTrailingSlash = false;
#171837
Nov 18, 2016 13:00
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.