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

Forums / General Discussions / Don't Want Homepage Redirected - How

Don't Want Homepage Redirected - How

11 posts, 2 answered
  1. Jeremy
    Jeremy avatar
    10 posts
    Registered:
    13 Apr 2009
    13 Nov 2009
    Link to this post
    When I go to www.sitefinity.com or www.ryland.com, both powered by sitefinity, I am not redirected to the URL of the homepage. Instead, I stay at the root of the URL. How can I do that? I want home to be www.domain.com not www.domain.com/home.aspx

    Also, how do I make it so all links in navigation (breadcrumbs, ect) to the homepage are to www.domain.com and not www.domain.com/home.aspx?
  2. Jeremy
    Jeremy avatar
    10 posts
    Registered:
    13 Apr 2009
    13 Nov 2009
    Link to this post
    I found

    redirectToHomePage="False" 

    which I added to the <cms tag in web.config which seems to take care of the homepage redirect if I type the domain in.

    But how do I get the menus to recognize to link to the homepage with www.domain.com or just "/'"?
  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    15 Nov 2009
    Link to this post
    Hello Jeremy,

    You can create a physical file in the project's root that has the same name as your default ICms page. For instance you have created a cms page called Default.aspx and it has been set to home. If you create a page with the same name as yoru home page in project's root you should get the same behavior as www.sitefinity.com and www.telerik.com.

    All the best,
    Ivan Dimitrov
    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.
  4. Jeremy
    Jeremy avatar
    10 posts
    Registered:
    13 Apr 2009
    16 Nov 2009
    Link to this post
    I have a page in my site with the virtual url of home.aspx. I then created a file named home.aspx and placed it at C:\Program Files\telerik\Sitefinity3.7\WebSites\MyWebsite\home.aspx

    After I did that, I reload the homepage and I get a not authorized IIS error page. For some reason when that flat file is there, I no longer have an accessible homepage.

    Any ideas why?
  5. Jeremy
    Jeremy avatar
    10 posts
    Registered:
    13 Apr 2009
    16 Nov 2009
    Link to this post
    I had home.aspx set in IIS as a possible default page. I deleted that and the page is accessible.

    But I still have the problem that my "Home" menu item links to "www.domain.com//home.aspx" instead of "www.domain.com"

    What am I missing?
  6. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    17 Nov 2009
    Link to this post
    Hello Jeremy,

    Thank you for the follow up.

    Unfortunately this could be fixed with a setting, since the Menu control is bound to the Sitemap, in which the the urls are relative to the domain, including the page name. That said, you should do the following:

    1. In the code behind of the menu, find the onDataBind event handler
    2. You will have an access to the current element by the arguments - e.item
    3. Check if e.item.NavigateUrl is "~/home.aspx" for example, if yes, change e.item.NavigateUrl="www.domain.com"

    I hope this helps. 

    Kind regards,
    Georgi
    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.
    Answered
  7. Jeremy
    Jeremy avatar
    10 posts
    Registered:
    13 Apr 2009
    17 Nov 2009
    Link to this post
    I searched the SiteMenu.ascx.cs file and can find no reference to "onDataBind". What am I missing?

    Can you show me an example of what this would look like and where it would go?
  8. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    17 Nov 2009
    Link to this post
    Hello Jeremy,

    I wasn't sure about the specific control that you use, and were suggesting the databind method. For the Sitemenu, the handler is:

    public void RadMenu1_ItemDataBound(object sender, RadMenuEventArgs e)

    You can add your logic there. 

    All the best,
    Georgi
    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.
    Answered
  9. Jeremy
    Jeremy avatar
    10 posts
    Registered:
    13 Apr 2009
    17 Nov 2009
    Link to this post
    This is what I did. I wanted to post it here to get feedback and for anyone else to reference.

    I'm assuming I will need to do this for ever menu? Or maybe I should be asking if there is a single place I can do this to affect all menus?

        public void RadMenu1_ItemDataBound(object sender, RadMenuEventArgs e) 
        { 
            if (this.hideUrlForGroupPages) 
            { 
                CmsSiteMapNode node = e.Item.DataItem as CmsSiteMapNode; 
                if (node != null) 
                { 
                    // save the PageID in the attributes of the menu item 
                    e.Item.Attributes.Add("PageID", node.Key); 
     
                    if (node.PageType == CmsPageType.Group) 
                    { 
                        e.Item.NavigateUrl = ""
                    } 
                } 
            } 
             
            // Added for canonical SEO homepage links 
            if (e.Item.NavigateUrl == "~/home.aspx") 
            { 
                e.Item.NavigateUrl = "~/"
            } 
        } 

    For items like this, are there ever clear update paths when new versions of SF come out?
  10. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    17 Nov 2009
    Link to this post
    Hi Jeremy,

    Unfortunately there is no single place on which the change could be made. But this is not specific to Sitefinity or the RadControls, this is how the standard SiteMap class works. As for the upgrades, you should be careful when you replace the controls, otherwise you might overwrite the changes you have done. This control is taking the RadMenu from the Telerik.Web.UI assembly, so when you change the assembly the control will automatically use the newer version of the RadMenu.

    By the way, when you use optimize the site thinking in about SEO practices and canonical url, you should also include rel="canonical" to your links - http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html

    Greetings,
    Georgi
    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.
  11. Jeremy
    Jeremy avatar
    10 posts
    Registered:
    13 Apr 2009
    17 Nov 2009
    Link to this post
    Great,

    Thanks for the info. Very helpful.

    In future releases you should consider making this the default behavior of SF. It really is a best practice for SEO.

    Thanks.
Register for webinar
11 posts, 2 answered