Alternative for IContentFinder when trying to match media redirects?
Hi!
Currently using Simple301 (old, archived redirect package) which is working fine for content nodes, but not working for media (e.g. pdf), working on implementing a replacement for this package but I am unable to find a way to use the IContentFinder interface's TryFindContent method to also match media items.
The IContentFinder will also match incoming requests to the media folder, and you can use a custom IContentFinder in order to provide a redirect for a Media Url however... if the file still exists on disk, it will always be served before Umbraco gets a chance to run it's pipeline of IContentFinders...
so if you delete the Media Item, and then delete it from the Recycle Bin - then request the url to the Media Item and it now 404s, you should then be able to use an IContentFinder to create a redirect.
Alternative for IContentFinder when trying to match media redirects?
Hi!
Currently using Simple301 (old, archived redirect package) which is working fine for content nodes, but not working for media (e.g. pdf), working on implementing a replacement for this package but I am unable to find a way to use the IContentFinder interface's TryFindContent method to also match media items.
Any idea's?
Hi Emiel
The IContentFinder will also match incoming requests to the media folder, and you can use a custom IContentFinder in order to provide a redirect for a Media Url however... if the file still exists on disk, it will always be served before Umbraco gets a chance to run it's pipeline of IContentFinders...
so if you delete the Media Item, and then delete it from the Recycle Bin - then request the url to the Media Item and it now 404s, you should then be able to use an IContentFinder to create a redirect.
Have a look at Skybrud redirects for a pretty full functioning redirects package: https://github.com/skybrud/Skybrud.Umbraco.Redirects/tree/dev-v7
regards
Marc
is working on a reply...