This is a discussion on mod_rewrite question within the Apache Web Server forums, part of the Web Server and Related Forums category; Hi I've recently got mod_rewrite compiled and configured for Apache on my webserver machine. It's working fine, i ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi
I've recently got mod_rewrite compiled and configured for Apache on my webserver machine. It's working fine, i know how to configure it, and so on. I'm hosting my own website from home, but have placed images onto my ISP's webspace and configured mod_rewrite to "rewrite" any URL's that are in the image dir (/img) to look on my ISP's webspace. Now, when people browse my site will _their_ browser grab the images from my ISP, or will _my_ webserver grab the images and send to the web broswer? The reason i setup mod_rewrite is to save my bandwidth, i.e. images are downloaded from my ISP. Does this make sense? Is this one of the things that mod_rewrite can do? If not can anyone recommend what i can do? TIA Ben |
|
|||
|
> Now, when people browse my site will _their_ browser grab the images
> from my ISP, or will _my_ webserver grab the images and send to the web > broswer? both is posible. > The reason i setup mod_rewrite is to save my bandwidth, i.e. images are > downloaded from my ISP. Does this make sense? Is this one of the things > that mod_rewrite can do? If not can anyone recommend what i can do? if you used the [R] flag for RewriteRule, or none at all, since it is an external absolute uri, the users browser will get a redirect and fetch the image from the given location. if you use [P] which is only available when mod_proxy is loaded, apache will work as a reverse proxy and fetch the image itself before delivering it to the user - double bandwidth penalty... joachim |
|
|||
|
Joachim Ring wrote:
>>The reason i setup mod_rewrite is to save my bandwidth, i.e. images are >>downloaded from my ISP. Does this make sense? Is this one of the things >>that mod_rewrite can do? If not can anyone recommend what i can do? > > > if you used the [R] flag for RewriteRule, or none at all, since it is > an external absolute uri, the users browser will get a redirect and > fetch the image from the given location. Here's the rule i used (yes it's without [R]) :- RewriteRule ^/img/(.*)$ http://www.benzalez.plus.com/2halfsimg/$1 When i load the page in my browser i can see the status bar quickly flash "connecting to www.benzalez.plus.com", but when i do a view source images still show as "img/whatever.gif". I take it when the broswer asks for "img/whatever.gif", apache then sends back a redirect to the www.benzalez.plus.com site? Ben |
|
|||
|
"bengee" <postmaster@localhost.localdomain> wrote in message news:O8Gcc.30620$Y%6.3769409@wards.force9.net... > I take it when the broswer asks for "img/whatever.gif", apache then > sends back a redirect to the www.benzalez.plus.com site? Easy way to tell is to look at the image properties in the browser, if it says the image is located on the ISP site then you have what you want, if it claims to be from your own server then you know it wasn't redirected (so probably proxied). Richard. |
|
|||
|
"Richard Antony Burton" <richardaburton-NOSPAM-@hotmail.com> schreef in
bericht news:NcGcc.12583464$Of.2094463@news.easynews.com.. . > "bengee" <postmaster@localhost.localdomain> wrote in message > news:O8Gcc.30620$Y%6.3769409@wards.force9.net... > > I take it when the broswer asks for "img/whatever.gif", apache then > > sends back a redirect to the www.benzalez.plus.com site? > Easy way to tell is to look at the image properties in the browser, if it says > the image is located on the ISP site then you have what you want, if it claims > to be from your own server then you know it wasn't redirected (so probably > proxied). After changing some settings and restarting Apache don't forget to flush your browsers cache...its data may prevent the browser from requesting the image from your server and you will not see a change in the properties of the image either. HansH |
|
|||
|
Richard Antony Burton wrote:
>>I take it when the broswer asks for "img/whatever.gif", apache then >>sends back a redirect to the www.benzalez.plus.com site? > > Easy way to tell is to look at the image properties in the browser, if it says > the image is located on the ISP site then you have what you want, if it claims > to be from your own server then you know it wasn't redirected (so probably > proxied). I looked at the image properties in my browser (Mozilla) and it says that the images come from my own server (2halfs.com). However, i tricked my webserver into thinking that www.benzalez.plus.com was somewhere else (edit /etc/hosts), and voila... the graphics still loaded in the browser. I then tricked my windows/web browser machine into thinking www.benzalez.plus.com was somewhere else (edit hosts files)... guess what? graphics couldn't be loaded. This confirms to me that it's the web browser that is trying to grab the images of www.benzalez.plus.com, and NOT my webserver :-) Thanks all Ben |