1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / changing the default url of migrated pages

changing the default url of migrated pages

3 posts, 0 answered
  1. Annie
    Annie avatar
    46 posts
    Registered:
    11 Aug 2012
    17 Apr 2012
    Link to this post
    Hi,

    I want to change the default url of the migrated pages. I would like to make them extension less. How do I do that?

    Thanks,
    Annie
  2. SelAromDotNet
    SelAromDotNet avatar
    912 posts
    Registered:
    18 Jul 2012
    17 Apr 2012
    Link to this post
    annie,

    the extension is stored in the PageNode under the Extensions property, You should be able to remove it with something like this:

    using (var api = App.WorkWith())
    {
        var pages = api.Pages().LocatedIn(PageLocation.Frontend).ThatArePublished()
            .ForEach(page =>
            {
                page.Extension = null;
            }).SaveChanges();
    }

    You can place this on a regular webforms page codebehind like test.aspx and run it to update the site. As always, be sure to backup the site first just in case.

    hope this is helpful!
  3. Annie
    Annie avatar
    46 posts
    Registered:
    11 Aug 2012
    18 Apr 2012
    Link to this post
    Thanks SelArom, I will try that
3 posts, 0 answered