Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- using htaccess to move stuff offsite
- Marty Fremen
June 14, 2008, 7:52 pm
rate this thread
domain hosting. Rather than altering the html files, I was thinking of just
putting a .htaccess in our /images/ directory:
RewriteRule ^(.+) http://www.example.com/images /$1
I'm assuming this will cause files that would originally have been got from
the images directory to instead be fetched from the external site, but am
wondering if the redirect will itself consume bandwidth. I've not done
htaccess type stuff before, am I right in assuming the amended url goes
back to the browser which then fetches it for itself, and that apache
doesn't actively proxy the requested file?
- Safalra (Stephen Morley)
June 14, 2008, 8:47 pm
Re: using htaccess to move stuff offsite
You need to stick an [R=301] on the end (or [R=302] if you only want a
temporary redirect). This will cause the server to send a 301 (or 302)
response to the client with the rewritten address. Proxying is only done
with a [P] on the end.
Safalra (Stephen Morley)
PHP References Tutorial: