November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
Hi,
You cannot have dots in the end of an URL - no matter if it's a blog post or a forum post, like this one. I've corrected the URLs now, and the developers in the Web Team are trying to find a "cleaning" solution for removing dots in the URL, here on World anyway.
Best regards,
Per Vikström
Online Manager
Team Leader Web Team
I can replicate that in Alloy site also and in my project also. that means client can break the site. It will be great if in online site we could restrict the editors to enter Dot in URL name field.
Regards
/K
We have noticed the same behavior and I'd say it's a bug in the way Episerver calculates the UrlSegment from the name. It should strip out periods. I believe the method in use is UrlSegment.GetUrlFriendlySegment. Looking at the code, there is a regexp that lists allowed characters, and it will explicitly allow periods (dots).
The reason '.' are allowed in the url segment is primarly for media where you want to have a segment like "myimage.png" and not e.g. "myimage_png".
It seems that Asp.net however does not allow request with a trialing '.' (that is the request never gets to EPiServer routing) so we should add a validation that urlsegment should not end with a '.'
I used this as workaround in a recent project:
/// <summary> /// You can publish content with URL segments that ends with a dot, but it will cause a 404, this should fix it. /// </summary> [InitializableModule] [ModuleDependency(typeof(ServiceContainerInitialization))] public class RemoveDotsInUrlSegmentInitializer : IInitializableModule { public void Initialize(InitializationEngine context) { var eventRegistry = ServiceLocator.Current.GetInstance<IContentEvents>(); eventRegistry.PublishingContent += EventRegistryOnPublishingContent; } /// <summary> /// Dots in the route segment generates a 404 /// </summary> private void EventRegistryOnPublishingContent(object sender, ContentEventArgs contentEventArgs) { var routable = contentEventArgs.Content as IRoutable; if(routable != null && !string.IsNullOrEmpty(routable.RouteSegment) && routable.RouteSegment.EndsWith(".")) { routable.RouteSegment = routable.RouteSegment.TrimEnd(new []{'.'}); contentEventArgs.Content = routable as IContent; } } public void Uninitialize(InitializationEngine context) {} public void Preload(string[] parameters) {} }
This is solved in the latest version of EPiServer. Could not find the bug report for this issue so I'm not sure in which specific version but the trailing dot is removed in the segment url in EPiServer version 8.3 (not in 8.1 as previously said).
PageName: "Øyvind D.C." get segment url "oyvind-d.c"
Hi,
I have published a blog that was assigned this url "http://world.episerver.com/blogs/K-Khan-/Dates/2014/12/trailing-slashes-in-website./"
it takes the visitors to, it looks me a bug somewhere in routing. I tested in alloy site, if we change Name In URL from "testpage" to "testpage." this page will not be resolve and will generate same error. I think it should be logged as bug if not before and need a fix.
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /blogs/K-Khan-/Dates/2014/12/trailing-slashes-in-website./