HighDots Forums  

Re: using htaccess to move stuff offsite

alt.html alt.html


Discuss Re: using htaccess to move stuff offsite in the alt.html forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Safalra (Stephen Morley)
 
Posts: n/a

Default Re: using htaccess to move stuff offsite - 06-14-2008 , 03:47 PM






Marty Fremen wrote:
Quote:
I want to relocate images to another server to save bandwidth on our main
domain hosting. Rather than altering the html files, I was thinking of just
putting a .htaccess in our /images/ directory:

RewriteEngine on
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?

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:
http://www.safalra.com/programming/p...nces-tutorial/


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.