Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Is it possible to have user specific home page in a sharepoint site? For example when User 1 logins to the site, Homepage 1 will be shown and when User 2 logins, Homepage 2 will appear.

share|improve this question

4 Answers 4

Quick alternative:

Se the landing page for everyone to a page with this as the code behind:

    using System;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.Utilities;
    using Microsoft.SharePoint.WebControls;
    using Framework.Logger;

    namespace HomeBridge
    {
        public partial class Redirect : LayoutsPageBase
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                using (new SPMonitoredScope("HomeBridge Redirect Page_Load"))
                {

                    {
                        try
                        {
                            string sHomeURL = null;

                            HomeBridgeEngine eng = new HomeBridgeEngine(SPContext.Current.Site);
                    sHomeURL = eng.GetHomeUrl(Context.Request.LogonUserIdentity.Name);

                            if (!string.IsNullOrEmpty(sHomeURL))
                                Context.Response.Redirect(sHomeURL, false);
                        }
                        catch (Exception ex)
                        {
                            Logger.LogError(ex, "HomeBridgeRedirect 3.0");
                        }
                    }
                }
            }
        }
    }

Then drop this in a class:

    using System;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Collections;
    using System.Collections.Specialized;
    using System.Collections.Generic;
    using System.Web;
    using System.Web.Caching;
    using System.Xml;

    using Microsoft.SharePoint;
    using Microsoft.SharePoint.Utilities;

    using Microsoft.Office.Server;
    using Microsoft.Office.Server.Administration;
    using Microsoft.Office.Server.UserProfiles;

    using Framework.Common;
    using Framework.Logger;


    namespace HomeBridge
    {
        public class HomeBridgeEngine
        {

            private SPSite _site;

            /// <summary>
            /// Constructor which takes a reference to the site collection.
            /// </summary>
            /// <param name="site"></param>
            public HomeBridgeEngine(SPSite site)
            {
                _site = site;
            }

            public string GetHomeUrl(string login)
            {
                using (new SPMonitoredScope("HomeBridge GetHomeUrl"))
                {
                    UserProfileManager profileManager = null;

                    string url = null;
                    url = "http://DefaultUrl.com";

                    string siteURLProfileDB = null;
                    _site = SPContext.Current.Site;
                    SPServiceContext context = SPServiceContext.GetContext(_site); 
                    try
                    {
                        profileManager = new UserProfileManager(context);
                    }
                    catch (Exception ex)
                    {
                        Logger.LogError(ex, "HomeBridgeEngine 3.0");
                        return url;
                    }

                    //Check if user exists in the Profile DB
                    if (profileManager.UserExists(login))
                    {
                        UserProfile user = null;

                        user = profileManager.GetUserProfile(login);


                        if (user["URL"].Value != null)
                        {
                            siteURLProfileDB = user["URL"].Value.ToString();
                            return siteURLProfileDB;
                        }

                    }
                    //User Account was not found on Profile DB.  Send user to a help page.
                    else
                    {
                        url = "http://Youreallyneedhelp.com";
                        return url;
                    }

                }
            }
        }
    }

Please not that I have removed a bunch of stuff that was not asked for in this question, so the code will likely work if you tweak it some to meet your needs. However, you will need to check the names as I have annonymized it without verifying that it still works after removing the proprietary bits.

share|improve this answer

Out of the box in SharePoint is not possible to redirect to different Home page based on the User. What you do is to create a Common home page and place a user control or WebPart that will detect the user logged in & redirect him to respective home page. It will cause a extra redirect HTTP 303.

If the reason to have multiple home page is to show different content to the user based on the group you can always have single Page with all the webparts that display all the content and hide/show the web part that is relevant to the user.

share|improve this answer
    
can you help on how to do this? how should I hide webparts based on user? –  MRAramesh Oct 18 '12 at 10:26
    
1. to hide the webpart based on user you can use Audience Targeting. Basically audience targeting allows you to customize a page based on the group of the person viewing it, so that a manager will go to "home.aspx" and see a top-sheet results WebPart that includes some statistics, but if a regular developer logs on to the same page, the WebPart won't appear. You could definitely do your permissions check within your custom WebPart's Render() method. If the user doesn't have the permissions, just don't render anything –  Anuja Oct 18 '12 at 10:32
    
another way is using script to hide the webpart techtrainingnotes.blogspot.in/2012/06/… , This blog will guide you to achieve that. –  Anuja Oct 18 '12 at 10:34

You can create a custom login page and redirect the user after the loggin event.

share|improve this answer

Not sure if this will satisfy your requirements but try the below options:

-Set the default homepage to point to the mysite/person.aspx page which can contain user specific web parts.

-Use "target audience" to display certain webparts to specific users/groups.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.