Copied to clipboard

Flag this post as spam?

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


  • Jonathan Roberts 409 posts 1063 karma points
    Jul 11, 2022 @ 11:17
    Jonathan Roberts
    0

    Media files giving 200 Status instead of 404 when missing

    Hi,

    Im using 8.18.4 - when a media file is missing it is giving a status of 200.

    www.xxx.com/media/3456667/mymissingfile.pdf gives a 200

    www.xxx.com/anyurl/3456667/mymissingfile.pdf gives a 404

    Any ideas how I can get a 404 status for missing PDFs in the Media?

    Thanks

  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    Jul 11, 2022 @ 12:16
    Huw Reddick
    0

    mmm, that's weird, I get a 404 if I try a fake media url (using 8.18.4)

  • Jonathan Roberts 409 posts 1063 karma points
    Jul 11, 2022 @ 12:31
    Jonathan Roberts
    0

    Apologies - I forgot to mention that we are using UmbracoFileSystemProviders.Azure when setting up on Azure.

    Is yours using this?

  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    Jul 11, 2022 @ 12:46
    Huw Reddick
    0

    no, I'm not using UmbracoFileSystemProviders.Azure sorry.

  • Jonathan Roberts 409 posts 1063 karma points
    Jul 11, 2022 @ 12:50
    Jonathan Roberts
    0

    No problem - I just noticed if we take Custom Errors OFF then it gives a 404

  • Jonathan Roberts 409 posts 1063 karma points
    Jul 11, 2022 @ 12:58
    Jonathan Roberts
    0

    I think we have found the fix: Turn Custom Errors OFF and update HTTPErrors to

    <httpErrors errorMode="Custom" existingResponse="Replace">
    
  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    Jul 11, 2022 @ 13:02
    Huw Reddick
    0

    Glad you got it sorted.

Please Sign in or register to post replies

Write your reply to:

Draft