Copied to clipboard

Flag this post as spam?

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

  • Eric Wilkinson 21 posts 91 karma points
    Jul 26, 2021 @ 18:39
    Eric Wilkinson

    uSync and SeoChecker Redirects for Media

    When a Media item's file is changed (by replacing the file with another, and saving) - the client is using the SeoChecker package to automatically create a redirect of the old media URL to the new media URL - so that old URLs that have been shared with others still work and point to the latest version. This works on a single environment, but when we push the change via uSync (complete) only the media item is updated and the redirect doesn't get re-applied on the new server. I saw in previous versions a call to the MediaService.Save for the item being sent, which I think would trigger the SeoChecker's logic. However, it does not seem to be triggering in this uSync version for umbraco v8 (or maybe it is and it just doesn't work to recreate redirects?).

    Is there a way to either A) trigger MediaService.Save for the updated media item, so that the redirect logic can be triggered and a redirect can be added, or B) use uSync to send the SeoChecker entries from one environment to the other when a linked media item is changed and pushed up?

  • Kevin Jump 2298 posts 14617 karma points MVP 7x c-trib
    Jul 26, 2021 @ 20:52
    Kevin Jump


    I might have to take a look into this, I am not sure what triggers SEO to add the redirect, but in theory the uSync sync will update the existing media item, so it should trigger all save events, that i (suspect) are where SEO checker listens and adds its redirect.

    Adding something to sync SEOChecker entries between environments is also something we could look at - an extension to uSync should be able to sync them - but if the first way works it would be a bit better as it would be automatic and you wouldn't be syncing any redirects you might not need.

    • I will take a look at see what the options are.
  • Eric Wilkinson 21 posts 91 karma points
    Jul 27, 2021 @ 13:07
    Eric Wilkinson

    Thank you Kevin! I'm very interested in your findings

  • Eric Wilkinson 21 posts 91 karma points
    Aug 02, 2021 @ 16:43
    Eric Wilkinson

    Update: this is now working as expected. I needed to turn on the "Redirect when node exists" option in General Settings in the SEO Checker. Updating the media (replacing the file with a new version of the file) the first time after a v7 to v8 upgrade changes the number value in /media/{number}/{filename}.{fileextension} URL in v8 from an integer to a unique alpha-numeric value. SEO Checker properly creates a redirect for the old path to a new. Using Push To Server on the media sends the change to the next environment. The SEO Checker on that environment also creates the Media Redirect there - as desired. The reason this wasn't working before is because when I previously would "Push to Environment", uSync doesn't automatically delete the old media file on the new environment that was associated with the updated media item. (The file would have gotten removed if I had used the uSync dashboard and had the "Remove deleted items" AND "Media / files" options checked for the uSync Push settings). Since I previously didnt have the "Redirect when node exists" option enabled, it wouldn't work on the target environment until I deleted the old media item (or enabled the setting).

    Hoping the details help somebody else out. Thanks Kevin for being so responsive and confirming that you also believed this should work in theory with uSync.

  • Richard Soeteman 4034 posts 12821 karma points MVP
    Aug 09, 2021 @ 07:42
    Richard Soeteman

    Sorry was on holiday but great it's working now :-)

Please Sign in or register to post replies

Write your reply to: