Redirect with htaccess for images onto another server without redirect looping

Posted by Jeff on Stack Overflow See other posts from Stack Overflow or by Jeff
Published on 2010-06-16T05:36:50Z Indexed on 2010/06/16 5:42 UTC
Read the original article Hit count: 661

Hey guys,

I currently have a host where my main site is hosted on. I have set up nginx on another server to mirror/cache files being requested if it doesn't have it already, in particular images and flv videos.

For example:

www.domain.com is my main site.

www.domain.com/video/video.flv

www.domain.com/images/1.png

I would like to ask apache to redirect it to imgserv.domain.com (imgserv.domain.com points to another server IP)

imgserv.domain.com/video/video.flv

imgserv.domain.com/images/1.png

Basically redirect everything with certain filetypes and preserving the structure of the URL, like flv etc.

I tried something but I am getting a redirect looping error. Could someone help me out?

Thank you!

© Stack Overflow or respective owner

Related posts about apache

Related posts about .htaccess