Is it possible to redirect non-HTML files with HTTP? And chaining redirects?

Posted by Earlz on Stack Overflow See other posts from Stack Overflow or by Earlz
Published on 2010-03-19T15:35:05Z Indexed on 2010/03/24 13:23 UTC
Read the original article Hit count: 238

Hello, I have been thinking about a neat way of load balancing and one thing that would be required is to be capable of loading an image on an HTML page from multiple locations without rewriting the URL(on each load)

So what I need to be able to do is have one URL which is the "static" URL. Such as http://example.com/myimage.png The image is not actually contained in example.com though. So example.com does a either a 302 or 301 or 307 HTTP response to cause a redirect to 2.example.com. How do browsers handle this with images like in this situation? Also, how do browsers handle multiple redirections for instance if 2.example.com also didn't contain it and it went to 3.example.com ? (Note, I am asking this because I've never seen a 301 redirect on anything but an HTML page)

Also, which status code would be best to use. 301 means "moved permanently" which this "move" isn't permanent so I don't want it cached. Should I use 307? Is that supported by search engines and modern browsers?

© Stack Overflow or respective owner

Related posts about http

Related posts about redirect