I have a sitecore multisite setup.
i\'m currently struggling with the \"duplicate content syndrome\" were google bots indexes my sites and is able to access the content
I agree that the standard ItemResolver is too forgiving with the URLs. Not only can you get the same page in any site, but you can also get duplicates by using the full Sitecore path (e.g. /sitecore/content/Site/page). On one project, where this was a big issue for the client, I created a custom ItemResolver that would be more strict. Here it is:
public class ItemResolver : Sitecore.Pipelines.HttpRequest.ItemResolver
{
public override void Process(HttpRequestArgs args)
{
Assert.ArgumentNotNull(args, "args");
if (((Context.Item == null) && (Context.Database != null)) && (args.Url.ItemPath.Length != 0))
{
if (Context.Domain.Name.ToLower() == "sitecore")
{
base.Process(args);
return;
}
Profiler.StartOperation("Resolve current item.");
string path = MainUtil.DecodeName(args.Url.ItemPath);
Item item = args.GetItem(path);
if (item != null)
{
Tracer.Info("Current item is \"" + path + "\".");
}
Context.Item = item;
Profiler.EndOperation();
}
}
}
If you compare this to the decompiled standard ItemResolver, you will see that it is the same code used for the first step. It just doesn't attempt to find the item using other means if that first step fails. Another nice benefit of this is that it runs a bit faster than the standard ItemResolver.