开发者

mod_rewrite: serve images form another server

how can i write a mod_rewrite rule to handle all the requests like http://mysite.example/images/IMAGE.gif|jpg|png and serve inste开发者_如何学Cad http://mystaticfiles.example/IMAGE.gif|jpg|png ?

Thanks


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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜