Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Emiel 31 posts 124 karma points
    Dec 23, 2019 @ 10:24
    Emiel
    0

    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?

  • Marc Goodson 2157 posts 14431 karma points MVP 9x c-trib
    Dec 23, 2019 @ 20:27
    Marc Goodson
    1

    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

Please Sign in or register to post replies

Write your reply to:

Draft