At the moment not. For the same reason You need it, SEOChecker needs to determine the 404. To bad you can only have one LastContentFinder in Umbraco. You can replace mine.
First you need to make sure that your custom content finder is registered after the SEO one. Do this by using the ComposeAfter attribute on the composer where you register your own custom content finder.
[ComposeAfter(typeof(SEOCheckerComposer))]
public class NotFoundComposer : IUserComposer
{
public void Compose(Composition composition)
{
// We need the SEO Redirect Content Finder in our custom
// content finder. So register the RedirectContentFinder.
composition.Register<RedirectContentFinder>();
composition.SetContentLastChanceFinder<Error404ContentFinder>();
}
}
In your custom Content Finder, inject the RedirectContentFinder and check if it finds something to redirect first. If not, then apply your own logic.
private readonly RedirectContentFinder redirectContentFinder;
public Error404ContentFinder(RedirectContentFinder redirectContentFinder)
{
this.redirectContentFinder = redirectContentFinder;
}
public bool TryFindContent(PublishedRequest request)
{
if (redirectContentFinder.TryFindContent(request))
{
return true;
}
// Your custom 404 logic
// Return true or false depending on whether our custom 404 page was found
return request.PublishedContent != null;
}
LastChanceContentFinder
Hi Richard,
Is it possible in Umbraco 8, SEO Checker 2.9, to have your own custom LastChanceContentFinder.
We need to be able to handle this ourselves, rather than SEO checker. However it seems to be taking control of this if URL redirecting is enabled.
Could you advise.
Thanks again, Gareth
At the moment not. For the same reason You need it, SEOChecker needs to determine the 404. To bad you can only have one LastContentFinder in Umbraco. You can replace mine.
Would this work? or would you need to remove yours?
Not Sure but best to remove mine I guess Otherwise it's first one wins.
Hi Gareth,
We managed to get this to work.
First you need to make sure that your custom content finder is registered after the SEO one. Do this by using the ComposeAfter attribute on the composer where you register your own custom content finder.
In your custom Content Finder, inject the RedirectContentFinder and check if it finds something to redirect first. If not, then apply your own logic.
is working on a reply...