Forums

Skip Navigation LinksHome / Developer Network / Forums / Sitefinity Older Versions (3.x): Set-up & Installation > Don't Show Home or default.aspx on root

Don't Show Home or default.aspx on root

  • Dale Overton avatar

    Posted on Jan 13, 2010 (permalink)

    All.  Using SF 3.6.  I want my users to go to www.mysite.com and to see the URL as www.mysite.com.  However, right now when they do this they get www.mysite.com/home.aspx.  OR, if I name the page default.aspx they will get www.mysite.com/default.aspx.  Here is what I have tried to do....

    A)  set the redirectToHomePage="false" in web.config on <cms> element
    B)  Remove all default page references in IIS for home.aspx and default.aspx
    C)  Setup a wildcard script map in IIS for .* pointed to the aspnet_isapi.dll
    D)  Create a physical file for default.aspx and home.aspx.

    Note, when I do D it just pulls up those aspx files, which of course are blank. 

    Note, I can make these work when I am doing this for anything other than the root directory.  So if I wanted www.mysite.com/about/about.aspx to display as www.mysite.com/about/ I have been able to make that work using steps A, B, and C.  BUT, I cannot get it to work for the root directory.

    I've almost pulled all of my hair out, anyone help before I pull the rest out?

    Thanks,

    Dale

    Reply

  • Radoslav Georgiev Radoslav Georgiev admin's avatar

    Posted on Jan 14, 2010 (permalink)

    Hi Dale Overton,

    Thank you for using our services.

    Could you please revert all changes you have made so far an try the following:

    1) Set a home page for your Sitefinity website through Sitefinity Administration.
    2) Lets say that your home page is called ~/home.aspx
    3) Go to IIS and add a default document for the home.aspx (as in attached image).
    4) Create an empty home.aspx physical page in the root of your website. Just as Default.aspx when you create a new project.

    This should be enough.

    Greetings,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Attached files

    Reply

  • Darren du Preez avatar

    Posted on Feb 19, 2010 (permalink)

    Hi, I am currently new to Sitefinity and have the following issue. I apologise if this is not the correct procedure in posting as well but I am having an issue in getting the set home page to work correctly.

    I have added the defaultdocument page to the same name as that of the home.aspx page created in Sitefinity in IIs. I have also added the "redirectToHomePage=false" in my web.config file. When I start my site I get the following error
    Object reference not set to an instance of an object. 
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
      
    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
      
    Source Error: 
      
      
    Line 30:     {
    Line 31: 
    Line 32:           if (context.User.Identity.IsAuthenticated == false && node.Title.Equals("Registration", StringComparison.OrdinalIgnoreCase))
    Line 33:             return true;
    Line 34: 
      

    This code is located in:
    public class RentaroomSitefinityCustomSiteMapProvider : CmsSiteMapProvider  
    {
        public RentaroomSitefinityCustomSiteMapProvider()
        {
            //
            // TODO: Add constructor logic here
            //
        }
      
            public override bool IsAccessibleToUser(HttpContext context, SiteMapNode node)
        {
      
              if (context.User.Identity.IsAuthenticated == false && node.Title.Equals("Registration", StringComparison.OrdinalIgnoreCase))
                return true;
      
              else if (context.User.Identity.IsAuthenticated == false && node.Title.Equals("Profile", StringComparison.OrdinalIgnoreCase))
                return false;
      
              else if (context.User.Identity.IsAuthenticated == true && node.Title.Equals("Registration", StringComparison.OrdinalIgnoreCase))
                return false;
              return base.IsAccessibleToUser(context, node);       
        }

    Help will be appreciated. If there is anything else that I must do or supply please let me know.

    Thanks,

    Reply

  • Radoslav Georgiev Radoslav Georgiev admin's avatar

    Posted on Feb 19, 2010 (permalink)

    Hi Darren du Preez,

    Thank you for using our services.

    This error you are getting is because either the HttpContext.Current.User is null or the node variable is. I suggest you break point this line and debug to see which variable is throwing a null value.

    Kind regards,
    Radoslav Georgiev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

    Reply

  • Posted on Aug 27, 2010 (permalink)

    Tried this solution but is not working for me. Site root always goes to Home.aspx
    Thanks

    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Aug 29, 2010 (permalink)

    Hi Hanadi,

    Could you tell which solution does not work, because the error that we see is null reference exception is a custom code which does not contains check for nulls?

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

    Reply

  • Nadya avatar

    Posted on Sep 2, 2010 (permalink)

    Hi Telerik Team,

    I have similar questin, I am using Sitefinity 3.7 SP3 and I have same problem, except that I have set the urls to be extensionless so now instead of http://www.mysite.com I have http://www.mysite.com/default. I have added a document named default and I have the Default.aspx that comes with the project template. I have added wildcard mapping, but may be there is something else for the extensionless urls case?

    Thank you!
    Cheers, Nadya

    Reply

  • Ivan Dimitrov Ivan Dimitrov admin's avatar

    Posted on Sep 2, 2010 (permalink)

    Hello Nadya,

    If redirectToHomePage is set to false you should not see the default home page ( the page should be marked as home in Sitefintiy). Extensionless url does not affect this behavior. I attached a sample video.

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

    Reply

  • Register for webinar
Skip Navigation LinksHome / Developer Network / Forums / Sitefinity Older Versions (3.x): Set-up & Installation > Don't Show Home or default.aspx on root