apache - Redirect with htaccess for images onto another server without redirect looping -


I currently have a host that is hosted on my main site; I have nginx mirror / cache on another server If the files are set up to be requested, it is not already specially in images and flawee videos.

For example:

www Domain.com is my main site.

www.domain.com/video/video.flv

www.domain.com/images/1.png

I am imgserv.domain from Apache I want to ask to redirect to .com (imgserv.domain.com indicates any other server IP)

imgserv.domain.com/video/video.flv

Imgserv.domain.com/images/1.png

Basically redirect everything to some file types and preserve the structure of the URL, like FLV etc.

I tried something but I'm getting a redirect looping error. Can someone help me?

Thank you!

This is what I have.

  Riveted enigen on rewrite conduit% {HTTP_HOST} ^ www .domain.com $ [NC] Redirect Match 302 ^ (. * ) \. Gif $ http://imgserv.domain.com/forums$1.gif Redirect Match 302 ^ (. *) \. Jpg $ http: // imgserv. Domain.com/forums$1.jpg RedirectMatch 302 ^ (. *) \ .png $ http://imgserv.domain.com/forums$1.png  

You are mixing two different modules: RewriteEngine and RewriteCond are from the time of RedirectMatch they can not work together.

Try this mod_rewrite example instead:

  RewriteEngine ONRewriteCond% {HTTP_HOST} ^ www \ .example \ .com $ [NC] RewriteRule ^. * \. (Gif | jpg | png) $ http://imgserv.example.com/forums/$0 [L, R]  

Comments

Post a Comment

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -