views:

14

answers:

1

Hi,

how can i write a mod_rewrite rule to handle all the requests like http://mysite.example/images/IMAGE.gif|jpg|png and serve instead http://mystaticfiles.example/IMAGE.gif|jpg|png ?

Thanks

A: 

As Pekka correct mentioned, you can send a Redirect ([R=301]) or you could use a the Proxy-flag ([P]) to send the request to a specific server. With the proxy method, you will lose the logging information about the requesting client, because you server mysite.example connect to mystaticfiles.example and grabs the content from their. You also double the bandwith, with in your system with a proxy.

client connection -> mysite.example -> proxy request to mystaticfiles.example
-> mystaticfiles.example sends file -> mysite.example -> sends file to client
DrDol