How to change the view from userdisp.aspx to MySite View?

This is fairly simple and easy,,,

you need your MySite URL, e.g. mysite url is http://sharepointserver:8085

now, go to your site collcetion --> site actions --> modify all site settings --> under Site Collection Administration: Portal site connection

here go and paste your URL and give it a name,,,


result: whenever you click on user, it will redirect you to mysite

Comments (13)

  1. arduk says:

    We have the current setup:

    http://intranet – this site is the base portal site which contains all of our news and links etc

    http://mysite – this is where the mysites are hosted

    http://sales – this would be the url for the sales area (there are several of these for the different areas/departments)

    Currently, the portal connection for each dept/area is set to point to http://intranet, which enables people to always return to the home page of the intranet.

    If I change the Portal connection to point to the mysite url, then clicking the portal link will take them to their mysite page, which seems a bit strange.

    Am I missing something? Or is there a different solution to my particular setup?



  2. wael says:

    am not sure if i get you right…

    so you want the when people click on mySite, it takes them there but not changing the url??

    is that what you want?

    if yes,

    tell me how did you implement mysite on that url? and how are you trying to link it?

    so i can take you from there 🙂


  3. arduk says:

    sorry if I didn’t make myself clear…I’ll try to clarify.

    http://intranet is”>http://intranet is the home page of the portal – this is what everyone has got set as their home page, and this is currently where all portal connections of all site collections point to, so the root link of the breadcrumb trail always takes the user back to http://intranet. This is currently functioning how we want it to

    the collection of mysites is located at http://mysite (this was setup as the location of mysites during the install. the MySites collection has its own web application) – when you click on the "My Site" link on any page, you are taken to your own personal site at http://mysite/personal/USERNAME/default.aspx. This is currently functioning how we want it to, except that when you click on a user in a site collection, it displays the userdisp.aspx page.

    When we click on a user anywhere in any of the sites, we would like to be taken to the user’s Mysite profile, instead of to the userdisp.aspx page.

    If I use the solution you have above, then it will mean that all of the portal connections will point to http://mysite instead of http://intranet – this is not desirable, as all of the corporate links and information is stored at http://intranet, and this is what we consider the "home page" of the portal.

    So we would like to maintain the portal connections as they are, pointing to http://intranet, but any time someone clicks on a user, we would like to be directed to the users mysite profile.

    Hopefully this is clearer, and hopefully there is a solution to this???

    Thanks in advance

  4. arduk says:

    I posted on here yesterday – did you not get that post? it doesn’t seem to have appeared…

  5. wael says:

    Sorry for the delay…

    ok i got you crystal clear,,,:)

    so what i would think up hear is having two zones…

    1- will have mysite alone which will be poinining always to http://mysite

    2-will have two:

    —> one is pointing to http://intranet

    —> and the other is pointing to http://intranet/mySite as for http://mysite

    let me know if you need help configuring this…

  6. arduk says:

    Thanks for getting back to me – no problems with the delay – when I didn’t see my second post I started to think that I hadn’t submitted it.

    I would appreciate help on getting this configured – are you talking about doing this through Alternate Access Mappings?

    Currently, if I go to http://intranet/mysite, it doesn’t redirect me to my mysite.

    Thanks again for your assistance – it is very much appreciated!

  7. arduk says:

    Have you had a chance to look at this? Hopefully you haven’t decided that what I want to do isn’t possible?

    I look froward to hearing from you when you get a chance.

    Thanks in advance!

  8. wael says:

    Sorry for my usual delay,,

    this answer i think will do your problem,,,

    you have a sharepoint site called:


    and another one with my site on it called:


    and you want to acess my site with:


    Solution i guess will be:

    – Go and Create new Site Collection by extending the same web Application that http://intranet reside on..

    – Then, point the site collection to the configuration DB of the http://MySite

    – Then, to make sure thing will work, follow the steps in my orignal thread to link the site collection with MySite,,

    i hope this will solve your problem,,

    please send me any further question, i’ll try to answer quickly, i am not in vacation anymore,,,

    good luck

  9. SharePoint 2007 sites that are created can have many configuration options, due to this some options…

  10. Tej says:


    We are trying to setup our intranet portal. Our setup is similar to the one described above

    http://Support this is a base portal where we collaborate our work items and discussions etc

    http://mysite this is where user mysite profiles are

    What we want to achieve is that from the support portal, if we click on the username, it should take us to thier mysite. Currently it takes us to the userdisp.aspx.

    I tried achieving the above by adding a protal connection. But unfortunately that adds Mysite as the root portal in the support site’s top breadcrumbs.

    To avoid using portal connections i modified the userdisp.aspx page. what it does now is, it locates the mysite url and checks weather the current user in question has a mysite or not, if so, it redirects to their my site and if not it stays at userdisp.aspx. Following is the code Snipit.

    string mySite=string.Empty;

    Microsoft.SharePoint.Administration.SPWebApplicationCollection wAppCollection = new Microsoft.SharePoint.Administration.SPWebApplicationCollection(Microsoft.SharePoint.Administration.SPWebService.ContentService);

    // Locate the Web application that has self service site creation enabled.

    // and get the URL of the MySite in the webapplication.

    foreach (Microsoft.SharePoint.Administration.SPWebApplication wApp in wAppCollection)


    if (wApp.SelfServiceSiteCreationEnabled)


    mySite = wApp.Sites[0].Url;




    // Check wether the my site exists for the requested account or not by searching for name, account,

    // work email etc fields on the site.

    SPSite site = new SPSite(mySite + "/Person.aspx?accountname=" + this.UserListForm.Item["Account"].ToString());

    SPWeb web = site.OpenWeb();

    string fields = string.Empty;

    SPList userList = web.SiteUserInfoList;

    SPQuery query = new SPQuery();

    //query.ViewFields = @"<FieldRef Name=’Title’/><FieldRef Name=’Name’/><FieldRef Name=’Notes’/><FieldRef Name=’Picture’/><FieldRef Name=’Email’/><FieldRef Name=’ID’/>";

    foreach (SPField f in UserListForm.Fields)


    query.ViewFields = @"<FieldRef Name=’" + f.ToString() + @"’/>";


    query.Query = string.Format(@"<Where><Eq><FieldRef Name=’ID’/><Value Type=’Int’>{0}</Value></Eq></Where>", Page.Request.Params["ID"]);

    SPListItemCollection items = userList.GetItems(query);

    // If the query returns more than 0 items then the MY site exists.

    // If my Site exits, redirect to the mysite of the user otherwise do nothing

    if (items.Count > 0)


    Response.Redirect(mySite + "/Person.aspx?accountname=" + this.UserListForm.Item["Account"].ToString());


    My Question is, Is there a better way to do this.

    Thanks in advance


  11. wael says:

    Hi Tej,

    Sorry for answering you late,

    for some reason i saw you post with the spam!! 🙂


    i wasn’t sure about your problem and if i get it right,,

    but modifying the userdisp.aspx will put you in the unsupported state! is it not advisable to edit any of OOB aspx pages…

    And about this:

    "I tried achieving the above by adding a protal connection. But unfortunately that adds Mysite as the root portal in the support site’s top breadcrumbs"

    Are you sure you took the exact steps -sorry for this comment-  but the steps above cannot do such thing

  12. NOTE: This is a re-post from my orginal blog post on DevCow – Set up SharePoint sites with user profiles and SSP correctly SharePoint 2007 sites that are created can have many configuration options, due to this some options can be overlooked. Most users

  13. Ian Morrish says:

    Sample code above is wrong! See for a solution that works or wait until SP2

Skip to main content