London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
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.
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?
[InitializableModule] [ModuleDependency(typeof(EPiServer.Web.InitializationModule))] public class RoutingInitialization : IInitializableModule { public void Initialize(InitializationEngine context) { //Add initialization logic, this method is called once after CMS has been initialized RouteConfig.RegisterRoutes(RouteTable.Routes); WebApiConfig.Register(GlobalConfiguration.Configuration); EPiServer.Web.Routing.ContentRoute.UseTrailingSlash = true; EPiServer.Web.UrlSegment.UseLowerCaseSegments = true; } public void Preload(string[] parameters) { } public void Uninitialize(InitializationEngine context) { //Add uninitialization logic } }
Hi,
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 www.mysite.com/url to automaticly add a slash at the end, so it ends up www.mysite.com/url/ when the user tries to access it.
Thanks!