1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 Is There a Way to Make Image Proxy to Follow 301 Redirects?

Discussion in 'XenForo Questions and Support' started by enivid, Sep 2, 2016.

  1. enivid

    enivid Member

    I have image proxy enabled in my forum. When adding images through URLs that do 301 redirects, it shows a broken image icon. When testing the URL via Test Image Proxy tool, it gives the following output

    <URL> could not be fetched or is not a valid image. The specific error message was: Received unexpected response code 301 (Moved Permanently)

    Is there any way to make Image Proxy resolve 301 redirect URLs in XenForo?
    Amin Sabet likes this.
  2. Mike

    Mike XenForo Developer Staff Member

    The short answer is no. This was just changed as it's an important part of the security fix we released.
    StarArmy likes this.
  3. enivid

    enivid Member

    How does it undermine security?
    Any plans to do anything with it?
    It breaks a lot of images where image hosting has moved.
  4. Mike

    Mike XenForo Developer Staff Member

  5. @Mike since this update a lot of hosts including imgur, gyzado, postimg, lightshot do not work with the image proxifier as they often redirect to a subdomain or different URL for the actual image, could you suggest any changes to make this work?
  6. dieg0

    dieg0 Active Member

    Same problem here, its really annoying and messing hundreds/thousands of images on my site... :cry:
  7. Nuno

    Nuno Active Member


    Does this affects all XF versions?
    I'm planning go to https in the coming months but this is very importa issue to deal with.

  8. Mr Lucky

    Mr Lucky Well-Known Member

    I think it is just 1.5.10 (and presumably later)
  9. Mr Lucky

    Mr Lucky Well-Known Member

    Are the redirects a constant? ie if it is just http redirecting to https it is something you could batch change to the actual redirected URL using:


    For example, see this post:


    change all


  10. enivid

    enivid Member

    It's from 1.5.10, but it has nothing to do with moving your forum to HTTPS. It is about the redirects of the image hosting.
  11. Mr Lucky

    Mr Lucky Well-Known Member

    It is for sure related to switching you forum to https, because you will find that suddenly even with Proxy Image ticked, all those redirected images are going to show an error, so they do need to be dealt with if you intend to use any version from 1.5.10

    When I switched to SSL, everything was fine until I did the upgrade to 1.5.10 :(
  12. enivid

    enivid Member

    I have switched to HTTPS on 1.5.10 and nothing changed in how the images were displaying - those that have been redirecting weren't showing before and aren't showing now, those that haven't been redirecting are still showing fine. I am using XF Proxy for images by the way.

    PS: Of course, I have also updated my XF database to replace all internal links replacing "http://" with "https://".
  13. Nuno

    Nuno Active Member

    I'm not using 1.5.10 yet but I need this to work without issues.
    My community lives from photos.
    Last edited: Oct 15, 2016
  14. Mr Lucky

    Mr Lucky Well-Known Member

    Nuno likes this.
  15. Nuno

    Nuno Active Member


    I tested this in my board and of course it doesn't work too since I applied the patch :(

    Reading @Mike words, what can we expect in the near, very near future? I can't change my site to https knowing some images will be gone!
  16. Amin Sabet

    Amin Sabet Well-Known Member

    You can change to https without enabling the image proxy. That's what I did, and the mixed content warnings have gone largely unnoticed.
    Nuno likes this.
  17. Nuno

    Nuno Active Member

    I have made some replacements to url from images that redirects to https.

    Eventually this will be a cat and mouse job :)
  18. Mr Lucky

    Mr Lucky Well-Known Member

Share This Page