When I browse to my startpage, e.g. /sv I get a blank page that just says "Default Page". However when I try /sv/ it works. Subpages like /sv/example work without slash though. I'm using Sitecore 7.1 with only MVC views.
When requesting URLs without a slash at the end, the "StripLanguage" processor of the preprocessRequest pipeline rewrites path to the value of the Settings.DefaultPageName setting ("default.aspx" by default). Since such page physically exists on your site, ASP.NET MVC routing system does not handle such request, and the file itself is served. This behavior is controlled over the RouteCollection.RouteExistingFiles property (false by default), please refer to the following article for the details: http://msdn.microsoft.com/en-us/library/system.web.routing.routecollection.routeexistingfiles.aspx. In other case, when a slash is added after a language, this won't happen, since the "StripLanguage" processor does not rewrite the path (which is also not an expected behavior). As a result, request URL does not match the "default.aspx" static file in the site and request is getting processed by ASP.NET MVC.
I suggest you to add the following setting to the "Web.config" file (instead of creating a "default.aspx" page), which points to the "default" page without extension:
<settings>
<setting name="DefaultAspxPageName" value="default"/>
</settings>
After that, the /default URL, without ".aspx" extension, will be processed by MVC and the appropriate item will be rendered independently of a slash after the language URL section. On my side it works.
I want to point out that the answer to this is not my own but given from the support over at Sitecore who I want to extend a big "Thank you!" to. I had googled this forever until they helped me and I thought that I want to have this document and easily found when others struggle with it. A bug is filed and they are working on fixing it.
Remove the default.aspx
file from the web root.
That will fix your problem.
DefaultAspxPageName is Hidden Setting.. We can find more such hidden settings..@
http://www.newguid.net/sitecore/2014/sitecore-hidden-string-configuration-settings/
© 2022 - 2024 — McMap. All rights reserved.
Settings.DefaultPageName
in web.config, I looked in the DLL and the code searches forDefaultAspxPageName
, which I couldn't find in config either! Is this just something you added to the config anyway? Either way, no way of finding this without some documentation! Nice find. – Radioman