Vulnerability in EPiServer.Forms

Try our conversational search powered by Generative AI!

Use Trailing Slash



How do I make sure UseTrailingSlash is set to true? Do I add the following to my global.asax Application_Start or is it something that has to be activated in web.config? 

EPiServer.Web.Routing.ContentRoute.UseTrailingSlash = true;

My mission is to make to automaticly add a slash at the end, so it ends up when the user tries to access it.


Oct 29, 2014 15:17

It is just a static boolean property that you typically you would like to set during initialization so you could do it either in Application_Start or in an IInitializableModule.

Oct 30, 2014 12:00

Thanks Johan, It worked for me.

Nov 05, 2014 16:49

What am i doing wrong:

I want to add the slash and also make the url lowercase..

this is my initialization module but url stays the same without slash and no lowercase: 

Am i doing something wrong?

    public class RoutingInitialization : IInitializableModule
        public void Initialize(InitializationEngine context)
            //Add initialization logic, this method is called once after CMS has been initialized
            EPiServer.Web.Routing.ContentRoute.UseTrailingSlash = true;
            EPiServer.Web.UrlSegment.UseLowerCaseSegments = true; 

        public void Preload(string[] parameters) { }

        public void Uninitialize(InitializationEngine context)
            //Add uninitialization logic
Aug 04, 2015 13:41
* 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.