Resolving: View all site content page in SharePoint 2010 showing parent content

There is a quite common problem in SharePoint 2010 that didn’t exist before in MOSS.
Here is the problem:

You create a main site collection and then a create a sub site under that site collection of any template you wish. Next thing you know when you click Site Actions-> View All Site content of the child site is that View All Site Content page shows you the content from the parent site.

This behavior doesn’t stop there. When you click Site Actions -> Site Settings – you will get an error saying that file was no found. Also if you have content editor web part that points to a link – you will get this error:

 Cannot retrieve the URL specified in the Content Link property. For more assistance, contact your site administrator.

The list of inconsistencies and errors goes on an on:

1. You can’t export the content of web parts and get “file not found” error.
2. If you have custom code that relies on SPContext.Current.Web – the value of the Web will point to the parent web even though you have explicitly called the page from the child web.
….

Here is the solution: or should I say, the real cause behind all this. Alternate Access Mapping in Central Administration is not configured properly.

Chances are that you’re accessing the site from your development machine using a “localhost” call or you’re referencing the SharePoint site from somewhere on your local network and specifying full domain of the site: http://sharepoint.myintranet.com. Whatever the scenario is – your Alternate Access Mapping (AAM) has to have all of those variants of URL specified in it to be able to identify the site properly. This might be a side effect of some improvement (since this has never happened in MOSS).

So if you’re referencing your site by “locahost”, make sure “localhost” is defined in AAM as default url. Or if you’re accessing the site by http://sharepoint.myintranet.com as intranet – make sure this URL is defined as intranet URL.

Good Luck!

This entry was posted in sharepoint, sharepoint 2010 and tagged , , , , . Bookmark the permalink.

Comments are closed.