It is possible to do that, invisible to the users (without redirect) ? I want t开发者_开发百科o save the bandwidth
If you want to avoid a redirect, you will have to proxy the requests. One way to do that is using mod_proxy
.
Note that you can combine mod_rewrite and mod_proxy.
As mod_rewrite's documentation describes:
'proxy|P' (force proxy) This flag forces the substitution part to be internally sent as a proxy request and immediately (rewrite processing stops here) put through the proxy module. You must make sure that the substitution string is a valid URI (typically starting with http://hostname) which can be handled by the Apache proxy module. If not, you will get an error from the proxy module. Use this flag to achieve a more powerful implementation of the ProxyPass directive, to map remote content into the namespace of the local server. Note: mod_proxy must be enabled in order to use this flag.
If you want to spare bandwidth, you need the client to do the actual transfer to your other host instead. To achieve this, you need to tell your client browser to change the url to load. This can only be done via redirect or similar mechanism afaik. The mod_proxy option will make the data loaded by your server and then dispatched to your client, ending in twice bandwidth use compared to local storage (where you only send to the client).
What is the issue with redirection to the image only ?
精彩评论