Friday, May 7, 2010

Managed Paths

Well, I have been bitten bad by these and that is why I am blogging about them.

So, in essence, managed paths provide a way to organize your content and standardize the navigation. There are two type of managed paths:
  1. Explicit inclusion:
    Explicit - ONLY one
    Inclusion - the path is included
    So together these two words mean that when you define a site-path as explicit inclusion, you can create only one site collection in it and the path you define will be used for navigation (i.e. the site collection will be created directly at the managed path and can accessed by simply typing the URL upto the managed path)
    Eg: Your site: http://intranet.company.com/  OR http://intranet/
          Manged path: sales
          This will create the ONLY site collection at the URL accessed as http://intranet.company.com/sales OR http://intranet/sales
          Typing these URLs in the browser will open the site-collections home/default page.
     
  2. Wildcard exclusion:Wildcard - Any or multiple
    Exclusion - the path itself is not included
    This means, when you define a site path as wildcard exclusion, you can create multiple sites under it and the site path itself is will not be included (i.e. there will be NO site-collection at the managed-path URL itself. All the site-collections will be created under the managed-path)
    Eg: Your site: http://intranet.company.com/ OR http://intranet/ 
    Manged path: projects
    Now when you create site collections the site-collection name will be appended to 'projects' and the URLs will look like http://intranet.company.com/projects/projA, http://intranet.company.com/projects/projB  OR http://intranet/projects/projA, http://intranet/projects/projB
    Typing the URL upto the site-path only, like http://intranet.company.com/projects OR http://intranet/projects, will give a '404: Page not found' error. You have to type the site-collection name to access a particular site-collection.
When you create a web-application two managed-paths are created by default:
  • root (/) - explicit inclusion
  • sites - wildcard exclusion
Its good idea to keep the root-site as explicit inclusion because it will allow users to browse to the home/default page when they access the site using the web-app name only, like http://intranet.company.com/ OR http://intranet/. If you make the root as wildcard exclusion accessing the above URLs will give the 404 error.

WARNING: Plan your managed-paths carefully and before you create your site-collections. Once you have created them DO NOT change them EVER. The reason is if you want to change a managed-path from say 'explicit inclusion' to 'wildcard exclusion' later down the road, the obvious thing you would do is delete the original entry for the managed path and add it back again (there is no edit option).
Sharepoint will allow you to do this without any problem or warning, BUT the site-collection you had will be deleted with the managed-path.


Deleting a managed-path deletes all the site-collections under it.

No comments:

Post a Comment