Sitecore gives a blank page with just the text “Default page” in my MVC solution

为君一笑 提交于 2019-11-30 03:18:42

问题


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.


回答1:


Remove the default.aspx file from the web root.
That will fix your problem.




回答2:


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.




回答3:


DefaultAspxPageName is Hidden Setting.. We can find more such hidden settings..@

http://www.newguid.net/sitecore/2014/sitecore-hidden-string-configuration-settings/



来源:https://stackoverflow.com/questions/21183998/sitecore-gives-a-blank-page-with-just-the-text-default-page-in-my-mvc-solution

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!