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

Forums / Developing with Sitefinity / Set Default Page Url

Set Default Page Url

4 posts, 0 answered
  1. Siddesh Kapadi
    Siddesh Kapadi avatar
    239 posts
    Registered:
    09 Oct 2009
    08 Jul 2011
    Link to this post
    Hi Team Siefinity,

    I have a unique requirement of setting the root page Url.

    Once, the user hits my domain, for example: http://mydomain.com/ the user is redirected to
    http://mydomain.com/index

    The Url should be http://mydomain.com/

    Can I set the default Page Url to "~/" by editing the properties of the root page.

    If yes, I tried doing so. But it says, "All optional URLs should be unique!". But upto the best of my knowledge, I do not have a page that is assigned this Page Url.

    Please let me know how can i achieve this.

    Regards,
    Siddesh Kapadi
  2. Siddesh Kapadi
    Siddesh Kapadi avatar
    239 posts
    Registered:
    09 Oct 2009
    08 Jul 2011
    Link to this post
    Hi,

    I tried this:
    ICmsPage pg = cMgr.GetPages().Cast<ICmsPage>().Where(x => x.StaticUrl == "~/").FirstOrDefault();

    But the pg Object is null i.e no page is assigned this Url.

    How can I assign the Page Url "~/" to the home page.

    Regards,
    Siddesh Kapadi
  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    08 Jul 2011
    Link to this post
    Hello Siddesh ,

    You could not have a page which static url is nothing

    x.StaticUrl == "~/"

    This is why the pg object is null. You need to provide an existing url. First you can loop through all pages to see the static urls that are available.

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  4. Siddesh Kapadi
    Siddesh Kapadi avatar
    239 posts
    Registered:
    09 Oct 2009
    08 Jul 2011
    Link to this post
    Hi Ivan,
    Can I assign "~/" to the StaticUrl of a page.

    Regards,
    Siddesh Kapadi
Register for webinar
4 posts, 0 answered