Extensionless Urls in Sitefinity5.0
Hi All,
Can any one give me a good idea about url without extensions in sitefinity ie i want to access a page with out entering the .aspx extension.Am using sitefinity5.0
Example:
' localhost:1900/Default.aspx ' This is the actual url.I want to access the same page by entering url like this ' http://localhost:1900/Default ' .
Thanks,
Vaiga
Vaiga,
By default, all urls for pages created in Sitefinity are created without any extension. are you by any chance migrating from Sitefinity 3.7? these urls are transferred including the extension
However you can remove page extensions from Sitefinity with the following sample code:
using
(var api = App.WorkWith())
var pages = api.Pages().LocatedIn(PageLocation.Frontend).ThatArePublished()
.ForEach(page =>
page.Extension =
null
;
).SaveChanges();