Step 1. Create the User Profile property
Navigate to the Central Administration site
Go to the User Profile Management page. This can be found under the Manage Service Applications link and then clicking on User Profile Service (it is possible it is named something else but this is the default)
Then click on Manage User Properties
Then click on New Property
Name the property something that makes sense like Home, leave the rest of the defaults, and click OK
For this solution the Home field will contain the part of the URL that is below the redirect page. For example if you wanted the user to go to http://sharepoint/engineeringyou would put the word engineering in the field and the redirect page would be at the http://sharepointlevel.
Step 2. Create or user a redirect page.
You have a couple of choices here. You can use the default home page. In this case users who don’t have anything in their Home property will simply stay on the home page. The other option is to create a page that is purely for redirection in which case nobody will stay on the page. It is just there for redirection, but you will need to set it to be the welcome page (this requires publishing to be turned on). It will work either way.
Step 3. Add the ASPX to the redirect page
Place the following ASPX code on the redirect page (doesn’t matter which way it was done in Step 2.) under the PlaceHolderMain content place holder.
<SPSWC:ProfilePropertyLoader id="m_objLoader" LoadFullProfileOfCurrentUser="true" runat="server"/>
<SPSWC:ProfilePropertyValue PropertyName="Home" runat="server"/>
s = spanName.innerText;
//remove the trailing spaces
s = s.replace(/\s+/g,'');
// redirect the user to
if(s != "")
location.href = "../" + s;
#SharePoint #user #profiles